Issue information

Issue ID
#1256
Status
Confirmed
Severity
None
Started
Hercules Elf Bot
Mar 23, 2008 17:26
Last Post
Hercules Elf Bot
Mar 23, 2008 17:26
Confirmation
N/A

Hercules Elf Bot - Mar 23, 2008 17:26

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

CODE
int skill_attack (int attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, int skillid, int skilllv, unsigned int tick, int flag)
{
...
    return damage;
}
this function returns the damage dealt (sometimes it's 0).

CODE
enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* target, unsigned int tick, int flag)
{
...
            return skill_attack(BF_WEAPON,src,src,target,MO_TRIPLEATTACK,skillv,tick,0);
...
        if (sc->data[SC_SACRIFICE])
            return skill_attack(BF_WEAPON,src,src,target,PA_SACRIFICE,sc->data[SC_SACRIFICE]->val1,tick,0);
        if (sc->data[SC_MAGICALATTACK])
            return skill_attack(BF_MAGIC,src,src,target,NPC_MAGICALATTACK,sc->data[SC_MAGICALATTACK]->val1,tick,0);
...
    return wd.dmg_lv;
}
this function directly returns the result of skill_attack. As you can see, there is a huge type mismatch going on here.
The return value is only used for counting attackers and calculating vit/flee penalties, so the impact of this screwup probably cannot be seen ingame.

This post has been edited by theultramage: Mar 23 2008, 11:16 AM