From c8db271ed9e69f369e73b58a62995adc91337e32 Mon Sep 17 00:00:00 2001 From: CairoLee Date: Sat, 12 Dec 2015 16:24:44 +0800 Subject: [PATCH 1/2] Fixed #652 #818 Signed-off-by: CairoLee --- src/map/npc.c | 2 -- src/map/script.c | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/map/npc.c b/src/map/npc.c index 6519c46cb0..4de48474ff 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1360,8 +1360,6 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type) clif_broadcast(&sd->bl,output,strlen(output) + 1,BC_BLUE,SELF); } - // reset the callshop state for future calls - sd->state.callshop = 0; sd->npc_shopid = id; if (type == 0) { diff --git a/src/map/script.c b/src/map/script.c index e2a656c4ba..30ab5fded2 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -9382,8 +9382,12 @@ BUILDIN_FUNC(end) if( st->mes_active ) st->mes_active = 0; - if (sd) - clif_scriptclose(sd, st->oid); // If a menu/select/prompt is active, close it. + if (sd){ + if (sd->state.callshop == 0) + clif_scriptclose(sd, st->oid); // If a menu/select/prompt is active, close it. + else + sd->state.callshop = 0; + } return SCRIPT_CMD_SUCCESS; } From 0c9218884d781156a3c842f37242e370181b402a Mon Sep 17 00:00:00 2001 From: CairoLee Date: Wed, 23 Dec 2015 11:56:31 +0800 Subject: [PATCH 2/2] Follow up to https://github.com/CairoLee/rathena/commit/c8db271ed9e69f369e73b58a62995adc91337e32 --- src/map/npc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/map/npc.c b/src/map/npc.c index 4de48474ff..1531dae207 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1341,9 +1341,6 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type) } if (nd->sc.option & OPTION_INVISIBLE) // can't buy if npc is not visible (hack?) return 1; - if( nd->class_ < 0 && !sd->state.callshop ) {// not called through a script and is not a visible NPC so an invalid call - return 1; - } if (nd->subtype == NPCTYPE_ITEMSHOP) { char output[CHAT_SIZE_MAX];