mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Merge pull request #3583 from CHOMPStation2/upstream-merge-12091
[MIRROR] Fixes AI subsystem locking up on trying to process null entries
This commit is contained in:
@@ -32,8 +32,11 @@ SUBSYSTEM_DEF(ai)
|
|||||||
while(currentrun.len)
|
while(currentrun.len)
|
||||||
var/datum/ai_holder/A = currentrun[currentrun.len]
|
var/datum/ai_holder/A = currentrun[currentrun.len]
|
||||||
--currentrun.len
|
--currentrun.len
|
||||||
|
if(!A || QDELETED(A) || A.busy) // Doesn't exist or won't exist soon or not doing it this tick
|
||||||
|
continue
|
||||||
|
|
||||||
var/mob/living/L = A.holder //VOREStation Edit Start
|
var/mob/living/L = A.holder //VOREStation Edit Start
|
||||||
if(!A || QDELETED(A) || !L?.loc || A.busy) // Doesn't exist or won't exist soon or not doing it this tick
|
if(!L?.loc)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if(process_z[get_z(L)] || !L.low_priority) //VOREStation Edit End
|
if(process_z[get_z(L)] || !L.low_priority) //VOREStation Edit End
|
||||||
|
|||||||
@@ -291,6 +291,9 @@
|
|||||||
|
|
||||||
// 'Tactical' processes such as moving a step, meleeing an enemy, firing a projectile, and other fairly cheap actions that need to happen quickly.
|
// '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()
|
/datum/ai_holder/proc/handle_tactics()
|
||||||
|
if(!istype(holder) || QDELETED(holder))
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
if(holder.key && !autopilot)
|
if(holder.key && !autopilot)
|
||||||
return
|
return
|
||||||
handle_special_tactic()
|
handle_special_tactic()
|
||||||
@@ -298,6 +301,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.
|
// '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()
|
/datum/ai_holder/proc/handle_strategicals()
|
||||||
|
if(!istype(holder) || QDELETED(holder))
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
if(holder.key && !autopilot)
|
if(holder.key && !autopilot)
|
||||||
return
|
return
|
||||||
handle_special_strategical()
|
handle_special_strategical()
|
||||||
|
|||||||
Reference in New Issue
Block a user