mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge pull request #12091 from Heroman3003/aifix2
Fixes AI subsystem locking up on trying to process null entries
This commit is contained in:
@@ -10,7 +10,7 @@ SUBSYSTEM_DEF(ai)
|
||||
var/list/currentrun = list()
|
||||
|
||||
var/slept_mobs = 0
|
||||
var/list/process_z = list()
|
||||
var/list/process_z = list()
|
||||
|
||||
/datum/controller/subsystem/ai/stat_entry(msg_prefix)
|
||||
..("P: [processing.len] | S: [slept_mobs]")
|
||||
@@ -32,10 +32,13 @@ SUBSYSTEM_DEF(ai)
|
||||
while(currentrun.len)
|
||||
var/datum/ai_holder/A = currentrun[currentrun.len]
|
||||
--currentrun.len
|
||||
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(!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
|
||||
if(!L?.loc)
|
||||
continue
|
||||
|
||||
if(process_z[get_z(L)] || !L.low_priority) //VOREStation Edit End
|
||||
A.handle_strategicals()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user