Merge pull request #3496 from Citadel-Station-13/upstream-merge-31609
[MIRROR] Adds type checks to HUD alert clicks to prevent ghosts from causing runtimes
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -586,7 +586,7 @@
|
||||
if(!force_moving)
|
||||
..(pressure_difference, direction, pressure_resistance_prob_delta)
|
||||
|
||||
/mob/living/proc/can_resist()
|
||||
/mob/living/can_resist()
|
||||
return !((next_move > world.time) || incapacitated(ignore_restraints = TRUE))
|
||||
|
||||
/mob/living/verb/resist()
|
||||
|
||||
@@ -356,6 +356,9 @@
|
||||
else
|
||||
M.LAssailant = usr
|
||||
|
||||
/mob/proc/can_resist()
|
||||
return FALSE //overridden in living.dm
|
||||
|
||||
/mob/proc/spin(spintime, speed)
|
||||
set waitfor = 0
|
||||
var/D = dir
|
||||
|
||||
Reference in New Issue
Block a user