mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
[MIRROR] Fixes strange geyser and geyser regen [MDB IGNORE] (#18808)
Fixes strange geyser and geyser regen (#72221) Called the random reagent code after it was initialized Registered the reagent del/remove signal on the geyser, not the reagent datum of the geyser Closes #72037 🆑 fix: Strange geysers have random reagents again fix: Geysers regen reagents again /🆑 Co-authored-by: Time-Green <timkoster1@hotmail.com>
This commit is contained in:
@@ -116,6 +116,7 @@
|
||||
#include "food_edibility_check.dm"
|
||||
#include "gas_transfer.dm"
|
||||
#include "get_turf_pixel.dm"
|
||||
#include "geyser.dm"
|
||||
#include "greyscale_config.dm"
|
||||
#include "hallucination_icons.dm"
|
||||
#include "heretic_knowledge.dm"
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
///Geysers listen to reagent signals to know when to start processing, which is very cool, smart, optimized and fragile
|
||||
///Tests:
|
||||
/// Check for reagent datum
|
||||
/// Check if our geyser starts with the right reagent
|
||||
/// Check if our geyser refills (by clearing the reagents, setting refresh rate to max and manually firing the subsystem)
|
||||
/// Check if our geyser refilled with the right reagent
|
||||
/datum/unit_test/geyser
|
||||
|
||||
/datum/unit_test/geyser/Run()
|
||||
//While we're at it just check em all
|
||||
var/list/geysers = subtypesof(/obj/structure/geyser)
|
||||
for(var/geyser_type as anything in geysers)
|
||||
var/obj/structure/geyser/wittel/geyser = allocate(geyser_type)
|
||||
geyser.potency = geyser.max_volume //make it recharge in 1 tick
|
||||
|
||||
TEST_ASSERT(geyser.reagents, "Geyser does not have a reagent datum! Source: [geyser.type]")
|
||||
TEST_ASSERT(geyser.reagents.has_reagent(geyser.reagent_id), "Geyser should start with [geyser.reagent_id], but started with [geyser.reagents.get_reagent_log_string()] instead. Source: [geyser.type]")
|
||||
|
||||
geyser.reagents.clear_reagents() //this should awaken the geyser to start refilling
|
||||
|
||||
SSplumbing.fire() //fire the subsystem, which calls process on the geyser which should refill it
|
||||
|
||||
TEST_ASSERT(geyser.reagents.total_volume == geyser.max_volume, "Geyser is not refilling! Current volume: [geyser.reagents.total_volume]. Target volume: [geyser.max_volume]. Source: [geyser.type]")
|
||||
TEST_ASSERT(geyser.reagents.has_reagent(geyser.reagent_id), "Geyser should produce [geyser.reagent_id], produced [geyser.reagents.get_reagent_log_string()] instead. Source: [geyser.type]")
|
||||
Reference in New Issue
Block a user