From c18ef364e6d2ad6eae8a1c0c647d1a2c7fb0fab1 Mon Sep 17 00:00:00 2001 From: 1080pCat <96908085+1080pCat@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:13:31 +1000 Subject: [PATCH] Mechas no longer get their attack cooldowns taken up by clicking the floor. And phazons finally deal burn on the burn mode (#28042) * Mechas no longer get their attack cooldowns taken up by clicking the floor, and phazons finally deal burn on the burn mode * lewc cooldown timer review --- code/game/mecha/mecha.dm | 12 ++++++------ .../modules/mob/living/carbon/human/human_defense.dm | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 57de741faf0..b8d369ca0a8 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -90,7 +90,7 @@ var/destruction_sleep_duration = 2 SECONDS //Time that mech pilot is put to sleep for if mech is destroyed var/melee_cooldown = 10 - var/melee_can_hit = TRUE + var/mecha_melee_cooldown = FALSE /// How many ion thrusters we got on this bad boy var/thruster_count = 0 @@ -263,12 +263,12 @@ else if(internal_damage & MECHA_INT_CONTROL_LOST) target = safepick(oview(1, src)) - if(!melee_can_hit || !isatom(target)) + if(mecha_melee_cooldown || !isatom(target)) return - target.mech_melee_attack(src) - melee_can_hit = FALSE - spawn(melee_cooldown) - melee_can_hit = TRUE + if(iswallturf(target) || isliving(target) || isobj(target)) + target.mech_melee_attack(src) + mecha_melee_cooldown = TRUE + addtimer(VARSET_CALLBACK(src, mecha_melee_cooldown, FALSE), melee_cooldown) /obj/mecha/proc/mech_toxin_damage(mob/living/target) playsound(src, 'sound/effects/spray2.ogg', 50, 1) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index cf4816db066..04cfc4d4562 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -781,7 +781,7 @@ emp_act update |= affecting.receive_damage(dmg, 0) playsound(src, 'sound/weapons/punch4.ogg', 50, TRUE) if("fire") - update |= affecting.receive_damage(dmg, 0) + update |= affecting.receive_damage(0, dmg) playsound(src, 'sound/items/welder.ogg', 50, TRUE) if("tox") M.mech_toxin_damage(src)