switch spawn pools from using IDs to typerefs (#29227)

This commit is contained in:
warriorstar-orion
2025-05-13 17:51:35 -04:00
committed by GitHub
parent 5039d1c84b
commit 04f5a04f32
7 changed files with 19 additions and 27 deletions
@@ -10,8 +10,8 @@
var/unique_picks = FALSE
/// Guaranteed spawners will always proc, and always proc first.
var/guaranteed = FALSE
/// The ID of the spawn pool. Must match the pool's [/datum/spawn_pool/var/id].
var/spawn_pool_id
/// The type of the spawn pool.
var/spawn_pool
/obj/effect/spawner/random/pool/Initialize(mapload)
// short-circuit atom init machinery since we won't be around long
@@ -19,7 +19,7 @@
stack_trace("Warning: [src]([type]) initialized multiple times!")
initialized = TRUE
if(!spawn_pool_id)
if(!spawn_pool)
stack_trace("No spawn pool ID provided to [src]([type])")
if(GLOB.spawn_pool_manager.finalized)
@@ -29,9 +29,9 @@
qdel(src)
return
var/datum/spawn_pool/pool = GLOB.spawn_pool_manager.get(spawn_pool_id)
var/datum/spawn_pool/pool = GLOB.spawn_pool_manager.get(spawn_pool)
if(!pool)
stack_trace("Could not find spawn pool with ID [spawn_pool_id]")
stack_trace("Could not find spawn pool [spawn_pool]")
if(unique_picks && !(type in pool.unique_spawners))
pool.unique_spawners[type] = loot.Copy()
@@ -42,9 +42,9 @@
pool.known_spawners |= src
/obj/effect/spawner/random/pool/generate_loot_list()
var/datum/spawn_pool/pool = GLOB.spawn_pool_manager.get(spawn_pool_id)
var/datum/spawn_pool/pool = GLOB.spawn_pool_manager.get(spawn_pool)
if(!pool)
stack_trace("Could not find spawn pool with ID [spawn_pool_id]")
stack_trace("Could not find spawn pool [spawn_pool]")
if(unique_picks)
var/list/unique_loot = pool.unique_spawners[type]
@@ -62,9 +62,9 @@
var/is_safe = FALSE
var/deduct_points = TRUE
var/datum/spawn_pool/pool = GLOB.spawn_pool_manager.get(spawn_pool_id)
var/datum/spawn_pool/pool = GLOB.spawn_pool_manager.get(spawn_pool)
if(!pool)
stack_trace("Could not find spawn pool with ID [spawn_pool_id]")
stack_trace("Could not find spawn pool [spawn_pool]")
if(ispath(type_path_to_make, /obj/effect/spawner/random/pool))
return TRUE