summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/script.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 0624e3047..b3f3e5355 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2659,7 +2659,8 @@ void run_script_main(struct script_state *st)
int bk_npcid = 0;
struct script_stack *stack=st->stack;
- if(st->rid) sd = map_id2sd(st->rid);
+ sd = st->rid?map_id2sd(st->rid):NULL;
+
if(sd){
if(sd->st != st){
bk_st = sd->st;