From 7c1447b414fe0ca732edc89013730a2bcb755dd9 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 1 Jun 2013 16:03:13 -0300 Subject: Fixed Bug #7312 http://hercules.ws/board/tracker/issue-7312-bug-instance/ Signed-off-by: shennetsind --- src/map/script.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/map') diff --git a/src/map/script.c b/src/map/script.c index 79199858a..a086c3f65 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -11191,7 +11191,7 @@ BUILDIN(mobcount) // Added by RoVeRT event = NULL; else check_event(st, event); - + if( strcmp(mapname, "this") == 0 ) { struct map_session_data *sd = script_rid2sd(st); if( sd ) @@ -11200,17 +11200,16 @@ BUILDIN(mobcount) // Added by RoVeRT script_pushint(st,-1); return true; } - } - else if( (m = map_mapname2mapid(mapname)) < 0 ) { + } else if( (m = map_mapname2mapid(mapname)) < 0 ) { script_pushint(st,-1); return true; } - - if( map[m].flag.src4instance && map[m].instance_id >= 0 && st->instance_id >= 0 && (m = instance->mapid2imapid(m, st->instance_id)) < 0 ) { + + if( map[m].flag.src4instance && map[m].instance_id == -1 && st->instance_id >= 0 && (m = instance->mapid2imapid(m, st->instance_id)) < 0 ) { script_pushint(st,-1); return true; } - + script_pushint(st,map_foreachinmap(buildin_mobcount_sub, m, BL_MOB, event)); return true; -- cgit v1.2.3-60-g2f50