Fixed some old mistakes in npc shop code causing misinterpretation of the number of function parameters (bugreport:404)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11788 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ultramage 2007-11-23 02:25:50 +00:00
parent d7bf36fe52
commit 128efc8d50

View File

@ -11765,8 +11765,8 @@ BUILDIN_FUNC(npcshopitem)
return 0; return 0;
} }
// st->end - 2 = nameid + value # ... / 2 = number of items // get the count of new entries
amount = (st->end-2)/2; amount = (script_lastdata(st)-2)/2;
// generate new shop item list // generate new shop item list
RECREATE(nd->u.shop.shop_item, struct npc_item_list, amount); RECREATE(nd->u.shop.shop_item, struct npc_item_list, amount);
@ -11794,7 +11794,8 @@ BUILDIN_FUNC(npcshopadditem)
return 0; 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 // append new items to existing shop item list
RECREATE(nd->u.shop.shop_item, struct npc_item_list, nd->u.shop.count+amount); RECREATE(nd->u.shop.shop_item, struct npc_item_list, nd->u.shop.count+amount);
@ -11823,7 +11824,7 @@ BUILDIN_FUNC(npcshopdelitem)
return 0; return 0;
} }
amount = (st->end-2)/2; amount = script_lastdata(st)-2;
size = nd->u.shop.count; size = nd->u.shop.count;
// remove specified items from the shop item list // remove specified items from the shop item list