summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/script.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 07497d892..959cf6bd9 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3464,8 +3464,10 @@ void run_script_main(struct script_state *st)
script_attach_state(st);
nd = map_id2nd(st->oid);
- if( nd )
+ if( nd && nd->bl.m >= 0 )
st->instance_id = map[nd->bl.m].instance_id;
+ else
+ st->instance_id = -1;
if(st->state == RERUNLINE) {
run_func(st);