summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-12-24 17:32:06 -0200
committershennetsind <ind@henn.et>2013-12-24 17:32:06 -0200
commit9258422d0dc8cdb5171aea5b36a6ae83346e52db (patch)
tree4acf7d07b621e58bdca3e685c28c51abd6888d82 /src/map/npc.c
parent337d3bf6bfa4a51c291d0b4420e1eb0b5a21f52d (diff)
downloadhercules-9258422d0dc8cdb5171aea5b36a6ae83346e52db.tar.gz
hercules-9258422d0dc8cdb5171aea5b36a6ae83346e52db.tar.bz2
hercules-9258422d0dc8cdb5171aea5b36a6ae83346e52db.tar.xz
hercules-9258422d0dc8cdb5171aea5b36a6ae83346e52db.zip
Follow up cf19b26d50ac96111e44c33a80afd1f1ea935cec
Fixed selllist on zeny trader. Special Thanks to Thunderbolt, bleachftl and Frost Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 44df2fe7a..dc29f04aa 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1483,8 +1483,8 @@ bool npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
switch( nd->u.scr.shop->type ) {
case NST_ZENY:
sd->state.callshop = 1;
- npc->buysellsel(sd,nd->bl.id,0);
- break;
+ clif->npcbuysell(sd,nd->bl.id);
+ return true;/* we skip sd->npc_shopid, npc->buysell will set it then when the player selects */
case NST_MARKET: {
unsigned short i;
@@ -2002,10 +2002,16 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
nullpo_retr(1, sd);
nullpo_retr(1, item_list);
- if( ( nd = npc->checknear(sd, map->id2bl(sd->npc_shopid)) ) == NULL || nd->subtype != SHOP ) {
+ if( ( nd = npc->checknear(sd, map->id2bl(sd->npc_shopid)) ) == NULL ) {
return 1;
}
+ if( nd->subtype != SHOP ) {
+ if( !(nd->subtype == SCRIPT && nd->u.scr.shop && nd->u.scr.shop->type == NST_ZENY) )
+ return 1;
+ }
+
+
z = 0;
// verify the sell list