diff options
-rw-r--r-- | doc/script_commands.txt | 4 | ||||
-rw-r--r-- | src/map/script.c | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 3784667cb..54d62b045 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -5286,7 +5286,9 @@ This command will destroy whatever is currently equipped in the invoking character's specified equipment slot. For a full list of possible equipment slots see 'getequipid'. -This command will return 1 if an item was deleted and 0 otherwise. +It is always a good idea to check if the player actually has the item you want +before you use this command. If you try to delete in a position that the player +has no gear, script will be terminated with an error. --------------------------------------- //===================================== diff --git a/src/map/script.c b/src/map/script.c index a0b9f80cc..401cb0757 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7994,12 +7994,14 @@ BUILDIN(delequip) if(i >= 0) { pc->unequipitem(sd,i,3); //recalculate bonus pc->delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT); - script_pushint(st,1); - } else { - script_pushint(st,0); + return true; } + + ShowError("script:delequip: no item found in position '%d' for player '%s' (AID:%d/CID:%d).\n", num, sd->status.name,sd->status.account_id, sd->status.char_id); + st->state = END; + clif->scriptclose(sd, st->oid); - return true; + return false; } /*========================================== |