diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-08-20 14:15:54 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-08-20 14:15:54 -0300 |
commit | 23f9c366f5f4ef968aaa39c33a32fb3e692f36a4 (patch) | |
tree | bd793bd1acd5a1d37941cd5c471e0f5887796e8c /npc/020-5/bracco.txt | |
parent | 99e5e1a5f70aaf887f38b5e22a96a948e06bb64f (diff) | |
download | serverdata-23f9c366f5f4ef968aaa39c33a32fb3e692f36a4.tar.gz serverdata-23f9c366f5f4ef968aaa39c33a32fb3e692f36a4.tar.bz2 serverdata-23f9c366f5f4ef968aaa39c33a32fb3e692f36a4.tar.xz serverdata-23f9c366f5f4ef968aaa39c33a32fb3e692f36a4.zip |
Update Bracco script because we added delitemidx. Guess what the bug was?
You cannot read the inv index... of an deleted item!
Diffstat (limited to 'npc/020-5/bracco.txt')
-rw-r--r-- | npc/020-5/bracco.txt | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/npc/020-5/bracco.txt b/npc/020-5/bracco.txt index 96b4ffc73..f30bc7fd9 100644 --- a/npc/020-5/bracco.txt +++ b/npc/020-5/bracco.txt @@ -15,28 +15,20 @@ .@index=getarg(0); .@price=getarg(1); - //failedremovecardsindex .@index, 0; // TODO: Fix this and upgrade server - delinventorylist(); - getinventorylist(); - .@item=@inventorylist_id[.@index]; - - // Error - if (.@item <= 0) - Exception(l("Error translating item ID @@ to @@ (Bracco, idx, id)", .@index, .@item), RB_DEFAULT|RB_SPEECH|RB_ISFATAL); - // Confirmation mesn; - mesc l("Really melt down your @@? It'll cost you @@ GP. This action cannot be undone!", getitemlink(.@item), .@price), 1; + mesc l("Really melt down your @@? It'll cost you @@ GP. This action cannot be undone!", getinvindexlink(.@index), .@price), 1; next; if (askyesno() == ASK_NO || Zeny < .@price) return; + // Report it was done + mesc l("@@ melt down your @@...", .name$, getinvindexlink(.@index)); + // Effective: delete item and GP - delitem .@item, 1; + delitemidx .@index, 1; Zeny-=.@price; - // This should be consistent but well... - mesc l("@@ melt down your @@...", .name$, getinvindexlink(.@index)); // TODO: Inventoryplace. // Add Items (if inventory is full, your fault and not mine) for (.@i=2;.@i < getargcount(); .@i++) { |