From 95c1abdfcb62211557fdd14b463a014e87882a2d Mon Sep 17 00:00:00 2001 From: epoque11 Date: Wed, 14 Dec 2011 00:37:17 +0000 Subject: - Fixed floating shops being accessible from any location through 3rd party programs - TODO: needs amending for the walking glitch (bugreport:5016) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15099 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/npc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/map/npc.c') diff --git a/src/map/npc.c b/src/map/npc.c index 3eb92dcf6..3a8ea376f 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1174,8 +1174,15 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type) } if (nd->sc.option&OPTION_INVISIBLE) // 無効化されている 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; + } + + // reset the callshop state for future calls + sd->state.callshop = 0; + sd->npc_shopid = id; - sd->npc_shopid=id; if (type==0) { clif_buylist(sd,nd); } else { -- cgit v1.2.3-60-g2f50