Issue information

Issue ID
#252
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Oct 19, 2007 6:58
Last Post
Hercules Elf Bot
Oct 19, 2007 6:58
Confirmation
N/A

Hercules Elf Bot - Oct 19, 2007 6:58

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

The problem is, that the equip position in unequip-function gets subtracted 2 times.

src/map/script.c
CODE
BUILDIN_FUNC(unequip)
{
    int i;
    size_t num;
    TBL_PC *sd;

    num = script_getnum(st,2) - 1;  // <-- First subtraction
    sd=script_rid2sd(st);
    if(sd!=NULL && num > 0 && num <= ARRAYLENGTH(equip))
    {
        i=pc_checkequip(sd,equip[num-1]);  // <-- Second (unnecessary) subtraction
        if (i >= 0)
            pc_unequipitem(sd,i,2);
        return 0;
    }
    return 0;
}