From 1088153bc45be5842f426255a0c950e88ebabd6f Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 20 Sep 2023 18:59:45 +0200 Subject: [PATCH] [MIRROR] [GBP: NO UPDATE] Fixes a bug where update_inefficiencies() would call update_wounds() and cause gauze to fall off on promotion/demotion of wound [MDB IGNORE] (#23822) * [GBP: NO UPDATE] Fixes a bug where update_inefficiencies() would call update_wounds() and cause gauze to fall off on promotion/demotion of wound (#78398) ## About The Pull Request Title. ## Why It's Good For The Game On some testing on a downstream, I found that demoting a wound to a lower level via replace_wound caused gauze to fall off. Same thing happened for promoting. I found the issue lied in the fact update_inefficiencies always called update_wounds which didnt tell the proc if a replacement was going on. ## Changelog :cl: fix: Gauze no longer falls off if a wound is demoted or promoted /:cl: * [GBP: NO UPDATE] Fixes a bug where update_inefficiencies() would call update_wounds() and cause gauze to fall off on promotion/demotion of wound --------- Co-authored-by: nikothedude <59709059+nikothedude@users.noreply.github.com> --- code/datums/wounds/_wounds.dm | 6 +++--- code/modules/surgery/bodyparts/wounds.dm | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/datums/wounds/_wounds.dm b/code/datums/wounds/_wounds.dm index b324ed858c0..faf1ef87057 100644 --- a/code/datums/wounds/_wounds.dm +++ b/code/datums/wounds/_wounds.dm @@ -310,7 +310,7 @@ start_limping_if_we_should() // the status effect already handles removing itself add_or_remove_actionspeed_mod() - update_inefficiencies() + update_inefficiencies(replaced) /datum/wound/proc/add_or_remove_actionspeed_mod() update_actionspeed_modifier() @@ -426,7 +426,7 @@ update_inefficiencies() /// Updates our limping and interaction penalties in accordance with our gauze. -/datum/wound/proc/update_inefficiencies() +/datum/wound/proc/update_inefficiencies(replaced_or_replacing = FALSE) if (wound_flags & ACCEPTS_GAUZE) if(limb.body_zone in list(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) if(limb.current_gauze?.splint_factor) @@ -444,7 +444,7 @@ if(initial(disabling)) set_disabling(!limb.current_gauze) - limb.update_wounds() + limb.update_wounds(replaced_or_replacing) start_limping_if_we_should() diff --git a/code/modules/surgery/bodyparts/wounds.dm b/code/modules/surgery/bodyparts/wounds.dm index 07107089791..1b50dbc8fd1 100644 --- a/code/modules/surgery/bodyparts/wounds.dm +++ b/code/modules/surgery/bodyparts/wounds.dm @@ -304,7 +304,7 @@ /obj/item/bodypart/proc/update_wounds(replaced = FALSE) SHOULD_CALL_PARENT(TRUE) - var/dam_mul = 1 //initial(wound_damage_multiplier) + var/dam_mul = 1 // we can (normally) only have one wound per type, but remember there's multiple types (smites like :B:loodless can generate multiple cuts on a limb) for(var/datum/wound/iter_wound as anything in wounds)