mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-29 19:52:12 +00:00
* Globals work
* Double access works
* All other things
* Revert "All other things"
This reverts commit 6574442eb6.
* More changes that compile and work
* IT WORKS AAAAAA
* Changes even more .len to length()
* Apply suggestions from code review
* Update code/datums/mind.dm
* Update code/__HELPERS/sorts/InsertSort.dm
Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>
* Update code/__HELPERS/sanitize_values.dm
Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>
---------
Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com>
Co-authored-by: Deniz <66401072+Oyu07@users.noreply.github.com>
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
SUBSYSTEM_DEF(npcpool)
|
|
name = "NPC Pool"
|
|
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
|
|
priority = FIRE_PRIORITY_NPC
|
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
|
offline_implications = "Simple animals will no longer process. Shuttle call recommended."
|
|
|
|
var/list/currentrun = list()
|
|
|
|
/datum/controller/subsystem/npcpool/get_stat_details()
|
|
return "SimpleAnimals: [length(GLOB.simple_animals[AI_ON])]"
|
|
|
|
/datum/controller/subsystem/npcpool/fire(resumed = FALSE)
|
|
|
|
if(!resumed)
|
|
var/list/activelist = GLOB.simple_animals[AI_ON]
|
|
src.currentrun = activelist.Copy()
|
|
|
|
var/list/currentrun = src.currentrun
|
|
|
|
while(length(currentrun))
|
|
var/mob/living/simple_animal/SA = currentrun[length(currentrun)]
|
|
--currentrun.len
|
|
if(!SA)
|
|
log_debug("npcpool encountered an invalid entry, resumed: [resumed], SA [SA], type of SA [SA?.type], null [SA == null], qdelled [QDELETED(SA)], SA in AI_ON list: [SA in GLOB.simple_animals[AI_ON]]")
|
|
GLOB.simple_animals[AI_ON] -= SA
|
|
continue
|
|
|
|
if(!SA.ckey && !SA.notransform)
|
|
if(SA.stat != DEAD)
|
|
SA.handle_automated_movement()
|
|
if(SA.stat != DEAD)
|
|
SA.handle_automated_action()
|
|
if(SA.stat != DEAD)
|
|
SA.handle_automated_speech()
|
|
if(MC_TICK_CHECK)
|
|
return
|