summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-23 02:25:50 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-23 02:25:50 +0000
commit74fa81ac159d73447ff6cc3e6ef9c70b29280ade (patch)
tree011af808857aeda361b814f54c9e0ed488b9736c /src/map/script.c
parent445a5a2282d1beddd88eeeae48a048d1748dd85d (diff)
downloadhercules-74fa81ac159d73447ff6cc3e6ef9c70b29280ade.tar.gz
hercules-74fa81ac159d73447ff6cc3e6ef9c70b29280ade.tar.bz2
hercules-74fa81ac159d73447ff6cc3e6ef9c70b29280ade.tar.xz
hercules-74fa81ac159d73447ff6cc3e6ef9c70b29280ade.zip
Fixed some old mistakes in npc shop code causing misinterpretation of the number of function parameters (bugreport:404)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11788 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/map/script.c b/src/map/script.c
index e5a7f832c..17d859289 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -11765,8 +11765,8 @@ BUILDIN_FUNC(npcshopitem)
return 0;
}
- // st->end - 2 = nameid + value # ... / 2 = number of items
- amount = (st->end-2)/2;
+ // get the count of new entries
+ amount = (script_lastdata(st)-2)/2;
// generate new shop item list
RECREATE(nd->u.shop.shop_item, struct npc_item_list, amount);
@@ -11794,7 +11794,8 @@ BUILDIN_FUNC(npcshopadditem)
return 0;
}
- amount = (st->end-2)/2;
+ // get the count of new entries
+ amount = (script_lastdata(st)-2)/2;
// append new items to existing shop item list
RECREATE(nd->u.shop.shop_item, struct npc_item_list, nd->u.shop.count+amount);
@@ -11823,7 +11824,7 @@ BUILDIN_FUNC(npcshopdelitem)
return 0;
}
- amount = (st->end-2)/2;
+ amount = script_lastdata(st)-2;
size = nd->u.shop.count;
// remove specified items from the shop item list