diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-02-28 11:17:49 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-02-28 11:17:49 -0300 |
commit | 49e77da74e6621f1a81cefff6fc597de9a821fbb (patch) | |
tree | c0c28a796259bca283f8fefc55c6c7b037c4df06 | |
parent | 1cde1c1a88955c6a87e24e7dbb7fece27d6a65e1 (diff) | |
download | serverdata-49e77da74e6621f1a81cefff6fc597de9a821fbb.tar.gz serverdata-49e77da74e6621f1a81cefff6fc597de9a821fbb.tar.bz2 serverdata-49e77da74e6621f1a81cefff6fc597de9a821fbb.tar.xz serverdata-49e77da74e6621f1a81cefff6fc597de9a821fbb.zip |
Fix a bug when throwing stuff on sewers
-rw-r--r-- | npc/functions/manhole.txt | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/npc/functions/manhole.txt b/npc/functions/manhole.txt index 669adef9..a56b6542 100644 --- a/npc/functions/manhole.txt +++ b/npc/functions/manhole.txt @@ -38,20 +38,18 @@ function script manhole_interact { .@id = requestitem(); - // If ID is invalid, there's not enough items, it is bound, it cannot be traded, etc. + // If ID is invalid if (.@id < 1) { mesc l("You give up."); close; } - if (countitem(.@id) < 1 || checkbound(.@id) || !getiteminfo(.@id, ITEMINFO_MAXCHANCE) || !getiteminfo(.@id, ITEMINFO_TRADE)) { - if (checkbound(.@id) || !getiteminfo(.@id, ITEMINFO_TRADE)) - mesc l("You cannot drop this item!"); - else if (!getiteminfo(.@id, ITEMINFO_MAXCHANCE)) - mesc l("This item is too precious, you cannot part with it!"); - else - mesc l("You give up."); + + // If there's not enough items, it is bound, it cannot be traded/dropped/sold, etc. + if (countitem(.@id) < 1 || checkbound(.@id) || getiteminfo(.@id, ITEMINFO_TRADE)) { + mesc l("You cannot drop this item!"); close; } + // Delete item and spawn it on the equivalent map delitem .@id, 1; makeitem .@id, 1, .@dest_map$, .@x+rand(-2, 2), .@y+rand(-2, 2); |