From bd7d43dcb5e7aab3518ca4bb439ce9124b13bf5f Mon Sep 17 00:00:00 2001 From: Toastical <20125180+Toastical@users.noreply.github.com> Date: Thu, 19 Jun 2025 21:22:03 +0300 Subject: [PATCH] Fix martial art combos not clearing themselves when martial art is removed (#29592) * reset martial art combo before removing * move reset to mind transfer * clear old body combos * reset combos when martial art removed --- code/datums/mind.dm | 1 + code/modules/martial_arts/martial.dm | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 2cccda719c1..635634fddba 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -153,6 +153,7 @@ transfer_actions(new_character) if(martial_art) for(var/datum/martial_art/MA in known_martial_arts) + MA.reset_combos(old_current) // Clear combos on old body if(MA.temporary) MA.remove(current) else diff --git a/code/modules/martial_arts/martial.dm b/code/modules/martial_arts/martial.dm index 5816ee052e3..70676bfc4eb 100644 --- a/code/modules/martial_arts/martial.dm +++ b/code/modules/martial_arts/martial.dm @@ -76,10 +76,14 @@ return check_combos(step, user, target, could_start_new_combo) return FALSE -/datum/martial_art/proc/reset_combos() +/datum/martial_art/proc/reset_combos(mob/living/carbon/human/H) current_combos.Cut() streak = "" - var/mob/living/carbon/human/owner = locateUID(owner_UID) + var/mob/living/carbon/human/owner + if(H) + owner = H + else + owner = locateUID(owner_UID) if(istype(owner) && !QDELETED(owner)) owner.hud_used.combo_display.update_icon(ALL, streak) for(var/combo_type in combos) @@ -168,6 +172,8 @@ var/datum/martial_art/MA = src if(!H.mind) return + if(H.hud_used) + reset_combos() deltimer(combo_timer) H.mind.known_martial_arts.Remove(MA) H.mind.martial_art = get_highest_weight(H)