Adds sanity checks to ssai ai_holders

This commit is contained in:
Atermonera
2022-01-18 18:01:49 -08:00
parent 4d8c43f106
commit 9c3bc8a017

View File

@@ -293,6 +293,9 @@
// 'Tactical' processes such as moving a step, meleeing an enemy, firing a projectile, and other fairly cheap actions that need to happen quickly.
/datum/ai_holder/proc/handle_tactics()
if(!istype(holder) || QDELETED(holder))
qdel(src)
return
if(holder.key && !autopilot)
return
handle_special_tactic()
@@ -300,6 +303,9 @@
// 'Strategical' processes that are more expensive on the CPU and so don't get run as often as the above proc, such as A* pathfinding or robust targeting.
/datum/ai_holder/proc/handle_strategicals()
if(!istype(holder) || QDELETED(holder))
qdel(src)
return
if(holder.key && !autopilot)
return
handle_special_strategical()