From dc64f58207be1682e5ba267bfb951d0ca09f56a7 Mon Sep 17 00:00:00 2001 From: Feenie <62373791+FeenieRU@users.noreply.github.com> Date: Sun, 13 Oct 2024 00:58:43 +0300 Subject: [PATCH] Batch of TG PRs 10/11 part II (#4469) (#5095) ## About The Pull Request Some bugfixes that got pushed while I was working on the previous batch, might as well get them in too. ## Changelog See autochangelogs Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> --- code/__DEFINES/is_helpers.dm | 2 +- .../mob/living/basic/farm_animals/bee/_bee.dm | 9 ++------- code/modules/reagents/reagent_containers.dm | 2 +- .../reagents/reagent_containers/cups/_cup.dm | 1 + code/modules/reagents/reagent_containers/misc.dm | 1 + code/modules/reagents/reagent_containers/spray.dm | 1 + code/modules/unit_tests/_unit_tests.dm | 1 + code/modules/unit_tests/bee.dm | 15 +++++++++++++++ html/changelogs/AutoChangeLog-pr-87150.yml | 4 ++++ html/changelogs/AutoChangeLog-pr-87151.yml | 4 ++++ html/changelogs/AutoChangeLog-pr-87163.yml | 4 ++++ 11 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 code/modules/unit_tests/bee.dm create mode 100644 html/changelogs/AutoChangeLog-pr-87150.yml create mode 100644 html/changelogs/AutoChangeLog-pr-87151.yml create mode 100644 html/changelogs/AutoChangeLog-pr-87163.yml diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 572b6f1197e..954aec32350 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -253,7 +253,7 @@ GLOBAL_LIST_INIT(turfs_pass_meteor, typecacheof(list( #define ismecha(A) (istype(A, /obj/vehicle/sealed/mecha)) -#define ismopable(A) (A && ((A.plane == FLOOR_PLANE) ? (A.layer <= FLOOR_CLEAN_LAYER) : (A.layer <= GAME_CLEAN_LAYER))) //If something can be cleaned by floor-cleaning devices such as mops or clean bots +#define ismopable(A) (A && ((PLANE_TO_TRUE(A.plane) == FLOOR_PLANE) ? (A.layer <= FLOOR_CLEAN_LAYER) : (A.layer <= GAME_CLEAN_LAYER))) //If something can be cleaned by floor-cleaning devices such as mops or clean bots #define isorgan(A) (istype(A, /obj/item/organ)) diff --git a/code/modules/mob/living/basic/farm_animals/bee/_bee.dm b/code/modules/mob/living/basic/farm_animals/bee/_bee.dm index 3c2aae36bc1..53f9c618c63 100644 --- a/code/modules/mob/living/basic/farm_animals/bee/_bee.dm +++ b/code/modules/mob/living/basic/farm_animals/bee/_bee.dm @@ -100,13 +100,8 @@ return ..() /mob/living/basic/bee/death(gibbed) - if(beehome) - beehome.bees -= src - beehome = null - beegent = null - if(flags_1 & HOLOGRAM_1 || gibbed) - return ..() - spawn_corpse() + if(!(flags_1 & HOLOGRAM_1) && !gibbed) + spawn_corpse() return ..() /// Leave something to remember us by diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 31a45ca592d..f10b337e9ae 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -38,7 +38,7 @@ /// The icon file to take fill icon appearances from var/fill_icon = 'icons/obj/medical/reagent_fillings.dmi' ///The sound this container makes when picked up, dropped if there is liquid inside. - var/reagent_container_liquid_sound = SFX_DEFAULT_LIQUID_SLOSH + var/reagent_container_liquid_sound = null /obj/item/reagent_containers/apply_fantasy_bonuses(bonus) . = ..() diff --git a/code/modules/reagents/reagent_containers/cups/_cup.dm b/code/modules/reagents/reagent_containers/cups/_cup.dm index 27a4d66515f..5d5cbce1254 100644 --- a/code/modules/reagents/reagent_containers/cups/_cup.dm +++ b/code/modules/reagents/reagent_containers/cups/_cup.dm @@ -9,6 +9,7 @@ icon_state = "bottle" lefthand_file = 'icons/mob/inhands/items/drinks_lefthand.dmi' righthand_file = 'icons/mob/inhands/items/drinks_righthand.dmi' + reagent_container_liquid_sound = SFX_DEFAULT_LIQUID_SLOSH ///Like Edible's food type, what kind of drink is this? var/drink_type = NONE diff --git a/code/modules/reagents/reagent_containers/misc.dm b/code/modules/reagents/reagent_containers/misc.dm index 8b13ab4a54b..735fd1b9fb1 100644 --- a/code/modules/reagents/reagent_containers/misc.dm +++ b/code/modules/reagents/reagent_containers/misc.dm @@ -128,6 +128,7 @@ has_variable_transfer_amount = FALSE volume = 5 spillable = FALSE + reagent_container_liquid_sound = null /obj/item/reagent_containers/cup/rag/Initialize(mapload) . = ..() diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index b32446902a6..be774198dd2 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -25,6 +25,7 @@ volume = 250 possible_transfer_amounts = list(5,10) var/spray_sound = 'sound/effects/spray2.ogg' + reagent_container_liquid_sound = SFX_DEFAULT_LIQUID_SLOSH /obj/item/reagent_containers/spray/ranged_interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers) return try_spray(interacting_with, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 3c5b69f02d7..172a3b64181 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -99,6 +99,7 @@ #include "bake_a_cake.dm" #include "barsigns.dm" #include "baseturfs.dm" +#include "bee.dm" #include "bespoke_id.dm" #include "binary_insert.dm" #include "bitrunning.dm" diff --git a/code/modules/unit_tests/bee.dm b/code/modules/unit_tests/bee.dm new file mode 100644 index 00000000000..dad3a4d1a73 --- /dev/null +++ b/code/modules/unit_tests/bee.dm @@ -0,0 +1,15 @@ +/// Test beegent transfer +/datum/unit_test/beegent + +/datum/unit_test/beegent/Run() + var/mob/living/basic/bee/bee = allocate(__IMPLIED_TYPE__) + var/turf/bee_turf = get_turf(bee) + var/datum/reagent/picked = GLOB.chemical_reagents_list[/datum/reagent/toxin/fentanyl] + bee.assign_reagent(picked) + bee.death() + var/obj/item/trash/bee/dead_bee = locate() in bee_turf + TEST_ASSERT_NOTNULL(dead_bee, "The bee did not leave a corpse.") + TEST_ASSERT_EQUAL(dead_bee.beegent, picked, "The bee's corpse did not have the correct beegent assigned.") + TEST_ASSERT(dead_bee.reagents.has_reagent(/datum/reagent/toxin/fentanyl), "The bee's corpse did not contain any of the beegent.") + // clean up, we aren't allocated + QDEL_NULL(dead_bee) diff --git a/html/changelogs/AutoChangeLog-pr-87150.yml b/html/changelogs/AutoChangeLog-pr-87150.yml new file mode 100644 index 00000000000..0a18c0a4369 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-87150.yml @@ -0,0 +1,4 @@ +author: "Melbert" +delete-after: True +changes: + - bugfix: "Dead bees maintain their color and reagents" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-87151.yml b/html/changelogs/AutoChangeLog-pr-87151.yml new file mode 100644 index 00000000000..7daffae9542 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-87151.yml @@ -0,0 +1,4 @@ +author: "grungussuss" +delete-after: True +changes: + - bugfix: "a lot of items that shouldn't slosh when picked up will no longer slosh" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-87163.yml b/html/changelogs/AutoChangeLog-pr-87163.yml new file mode 100644 index 00000000000..581efe02080 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-87163.yml @@ -0,0 +1,4 @@ +author: "FlufflesTheDog" +delete-after: True +changes: + - bugfix: "Mops and similar work properly on multi-z stations" \ No newline at end of file