Browse Source

Fixed sleep timers getting freed twice
* Fixes #2042.
Thanks to @Encon21!

aleos 8 years ago
parent
commit
4b9ade33ee
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/map/script.c

+ 2 - 1
src/map/script.c

@@ -4063,7 +4063,8 @@ void script_stop_sleeptimers(int id) {
 		if (!st)
 		if (!st)
 			break; // No more sleep timers
 			break; // No more sleep timers
 
 
-		script_free_state(st);
+		if (st->oid == id)
+			script_free_state(st);
 	}
 	}
 }
 }