From a232a8868a5702ec698c161de44e43198246043c Mon Sep 17 00:00:00 2001 From: "natakilar@gmail.com" Date: Mon, 6 Mar 2023 23:34:50 -0500 Subject: [PATCH] Fixes runtime spam on load --- mods/persistence/game/objects/obj.dm | 4 ++-- mods/persistence/modules/hydroponics/trays.dm | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mods/persistence/game/objects/obj.dm b/mods/persistence/game/objects/obj.dm index 78aadedd5ce..f6f7daf15fc 100644 --- a/mods/persistence/game/objects/obj.dm +++ b/mods/persistence/game/objects/obj.dm @@ -11,6 +11,6 @@ SAVED_VAR(/obj, buckled_mob) /obj/initialize_reagents(populate) if(persistent_id) - . = ..(FALSE) + return // We don't call parent since it checks if reagents are already initialized. else - . = ..() + . = ..() \ No newline at end of file diff --git a/mods/persistence/modules/hydroponics/trays.dm b/mods/persistence/modules/hydroponics/trays.dm index e9ce2132604..35b26423bc8 100644 --- a/mods/persistence/modules/hydroponics/trays.dm +++ b/mods/persistence/modules/hydroponics/trays.dm @@ -47,6 +47,13 @@ . = ..() /obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Initialize(mapload, datum/seed/newseed, start_mature) - if(istext(newseed)) + if(persistent_id) + newseed = seed + else if(istext(newseed)) newseed = SSplants.seeds[newseed] + + // TODO: As above, Init resets health. Move things into appropriate procs upstream when possible. + var/old_health = plant_health . = ..(mapload, newseed, start_mature) + plant_health = old_health + check_plant_health() \ No newline at end of file