Adds sanity check to spin()

This commit is contained in:
Heroman
2023-08-15 17:40:56 +10:00
parent afc739c27d
commit 312b5e2a28
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -1153,7 +1153,7 @@
has_been_heated = 1
user.visible_message("<span class='notice'>[user] crushes \the [src] package.</span>", "You crush \the [src] package and feel a comfortable heat build up. Now just to wait for it to be ready.")
spawn(200)
if(src)
if(!QDELETED(src))
if(src.loc == user)
to_chat(user, "You think \the [src] is ready to eat about now.")
heat()
+2
View File
@@ -296,6 +296,8 @@ note dizziness decrements automatically in the mob's Life() proc.
return TRUE //Found an item, doing item attack animation.
/mob/proc/spin(spintime, speed)
if(!speed || speed < 1) // Do NOT spin with infinite speed, it will break the reality
return
spawn()
var/D = dir
while(spintime >= speed)