git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7933 54d463be-8e91-2dee-dedb-b68131a5f0ec
@@ -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;