Issue information

Issue ID
#4633
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Dec 11, 2010 10:16
Last Post
Hercules Elf Bot
Dec 11, 2010 10:16
Confirmation
N/A

Hercules Elf Bot - Dec 11, 2010 10:16

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

Hi, there's a little typo on int intif_parse_mercenary_received(int fd), it's showing the size of s_homunculus when it should show the size of s_mercenary.

CODE
if( battle_config.etc_log )
    ShowError("intif: create mercenary data size error %d != %d\n", sizeof(struct s_homunculus), len);


Also intif_parse_CreateHomunculus and intif_parse_RecvHomunculusData are using the same snippet:
CODE
int intif_parse_CreateHomunculus(int fd)
{
    int len;
    len=RFIFOW(fd,2)-9;
    if(sizeof(struct s_homunculus)!=len) {
        if(battle_config.etc_log)
            ShowError("intif: create homun data: data size error %d != %d\n",sizeof(struct s_homunculus),len);
        return 0;
    }
    merc_hom_recv_data(RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,9), RFIFOB(fd,8));
    return 0;
}

int intif_parse_RecvHomunculusData(int fd)
{
    int len;

    len=RFIFOW(fd,2)-9;

    if(sizeof(struct s_homunculus)!=len) {
        if(battle_config.etc_log)
            ShowError("intif: homun data: data size error %d %d\n",sizeof(struct s_homunculus),len);
        return 0;
    }
    merc_hom_recv_data(RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,9), RFIFOB(fd,8));
    return 0;
}

Won't it be better if those functions were merged into a single one?


Regards.