Adds type checks to HUD alert clicks to prevent ghosts from causing runtimes (#31609)

* Update alert.dm

* better fix
This commit is contained in:
kevinz000
2017-10-19 00:00:16 -07:00
committed by CitadelStationBot
parent 02fcc06eb1
commit 0aa2e6b6a2
3 changed files with 7 additions and 4 deletions
+3 -3
View File
@@ -243,7 +243,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
/obj/screen/alert/fire/Click()
var/mob/living/L = usr
if(!L.can_resist())
if(!istype(L) || !L.can_resist())
return
L.changeNext_move(CLICK_CD_RESIST)
if(L.canmove)
@@ -559,7 +559,7 @@ so as to remain in compliance with the most up-to-date laws."
/obj/screen/alert/restrained/Click()
var/mob/living/L = usr
if(!L.can_resist())
if(!istype(L) || !L.can_resist())
return
L.changeNext_move(CLICK_CD_RESIST)
if((L.canmove) && (L.last_special <= world.time))
@@ -567,7 +567,7 @@ so as to remain in compliance with the most up-to-date laws."
/obj/screen/alert/restrained/buckled/Click()
var/mob/living/L = usr
if(!L.can_resist())
if(!istype(L) || !L.can_resist())
return
L.changeNext_move(CLICK_CD_RESIST)
if(L.last_special <= world.time)