summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-01 09:37:50 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-01 09:37:50 +0000
commit74a30ea8d414cec9fba211298c72b2a686b0582a (patch)
treec8c111060aad9e80949fd07d77104c1c6747a299 /src/map/clif.c
parenta41884fbb032359e4f0bfcdaee50acb749ed8862 (diff)
downloadhercules-74a30ea8d414cec9fba211298c72b2a686b0582a.tar.gz
hercules-74a30ea8d414cec9fba211298c72b2a686b0582a.tar.bz2
hercules-74a30ea8d414cec9fba211298c72b2a686b0582a.tar.xz
hercules-74a30ea8d414cec9fba211298c72b2a686b0582a.zip
Fixed the dynamic shop system memory allocation and id_db problem. Added sample script.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5842 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 9ce77129d..1f51506b1 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8974,7 +8974,6 @@ void clif_parse_NpcBuyListSend(int fd,struct map_session_data *sd)
n = (RFIFOW(fd,2)-4) /4;
item_list = (unsigned short*)RFIFOP(fd,4);
-
if (sd->trade_partner || !sd->npc_shopid){
fail = 1;
}else{
@@ -8983,8 +8982,8 @@ void clif_parse_NpcBuyListSend(int fd,struct map_session_data *sd)
for(i=0;i<n;i++){
setd_sub(sd, "@bought_nameid", i, (void *)item_list[i*2+1]);
setd_sub(sd, "@bought_quantity", i, (void *)item_list[i*2]);
- npc_event(sd, npc_ev, 0);
}
+ npc_event(sd, npc_ev, 0);
fail = 0;
}else{
fail = npc_buylist(sd,n,item_list);
@@ -9019,10 +9018,10 @@ void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
if((nd = ((struct npc_data *)map_id2bl(sd->npc_shopid))->master_nd)){
sprintf(npc_ev, "%s::OnSellItem", nd->exname);
for(i=0;i<n;i++){
- setd_sub(sd, "@sold_nameid", i, (void *)item_list[i*2+1]);
- setd_sub(sd, "@sold_quantity", i, (void *)item_list[i*2]);
- npc_event(sd, npc_ev, 0);
+ setd_sub(sd, "@sold_nameid", i, (void *)sd->status.inventory[item_list[i*2]-2].nameid);
+ setd_sub(sd, "@sold_quantity", i, (void *)item_list[i*2+1]);
}
+ npc_event(sd, npc_ev, 0);
fail = 0;
}else{
fail = npc_selllist(sd,n,item_list);