Issue information

Issue ID
#3313
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Jun 30, 2009 17:48
Last Post
Hercules Elf Bot
Jun 30, 2009 17:48
Confirmation
N/A

Hercules Elf Bot - Jun 30, 2009 17:48

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3313

CODE
int clif_sendegg(struct map_session_data *sd)
{
...
    WFIFOHEAD(fd, MAX_INVENTORY * 2 + 4);
    WFIFOW(fd,0)=0x1a6;
    if(sd->status.pet_id <= 0) {
        for(i=0,n=0;i<MAX_INVENTORY;i++){
            if(sd->status.inventory[i].nameid<=0 || sd->inventory_data[i] == NULL ||
               sd->inventory_data[i]->type!=IT_PETEGG ||
               sd->status.inventory[i].amount<=0)
                continue;
            WFIFOW(fd,n*2+4)=i+2;
            n++;
        }
    }
    WFIFOW(fd,2)=4+n*2;
    WFIFOSET(fd,WFIFOW(fd,2));

Shouldn't that outer if() be at the beginning of this function, and cause a total abort instead of continuing?
This might have been done to prevent the client from choking, however I believe this is not the official way of handling it.
To reproduce, hatch a pet, and then use an incubator.