summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index c224e4d95..13cd7d8e7 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10224,8 +10224,10 @@ int buildin_npcshopdelitem(struct script_state *st)
size = n = 0;
- while (nd->u.shop_item[n].nameid)
+ while (nd->u.shop_item[n].nameid){
size++;
+ n++;
+ }
nd = (struct npc_data *)aRealloc(nd,sizeof(struct npc_data) +
sizeof(nd->u.shop_item[0]) * (size+1));