From 04d4e001f1a1d9b2b605d0cfb58cb859a63a672a Mon Sep 17 00:00:00 2001 From: Jacquerel Date: Sat, 19 Aug 2023 19:57:50 +0100 Subject: [PATCH] Don't sleep in ability.Activate() when breathing fire (#77673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## About The Pull Request The global proc `dragon_fire_line` sleeps, and was being called inside `ability.Activate` This made the CI fail on a different PR because the mob stopped existing between activating the ability and triggering its cooldown, which should not regularly be possible. The ice whelp refactor author noticed this when using it in a loop but I guess didn't think about the other implications 😅 ## Why It's Good For The Game Fixes a bug. ## Changelog Not player facing --- code/datums/actions/mobs/fire_breath.dm | 3 ++- .../mob/living/basic/icemoon/ice_whelp/ice_whelp_abilities.dm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/datums/actions/mobs/fire_breath.dm b/code/datums/actions/mobs/fire_breath.dm index 1cc830e6de1..254a6081425 100644 --- a/code/datums/actions/mobs/fire_breath.dm +++ b/code/datums/actions/mobs/fire_breath.dm @@ -24,7 +24,8 @@ /datum/action/cooldown/mob_cooldown/fire_breath/proc/fire_line(atom/target, offset) SLEEP_CHECK_DEATH(0, owner) var/list/turfs = line_target(offset, fire_range, target) - dragon_fire_line(owner, turfs, ice_breath) + // This proc sleeps + INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(dragon_fire_line), owner, /* burn_turfs = */ turfs, /* frozen = */ ice_breath) /datum/action/cooldown/mob_cooldown/fire_breath/proc/line_target(offset, range, atom/target) if(!target) diff --git a/code/modules/mob/living/basic/icemoon/ice_whelp/ice_whelp_abilities.dm b/code/modules/mob/living/basic/icemoon/ice_whelp/ice_whelp_abilities.dm index fa42958f9a0..d5dc50d0a69 100644 --- a/code/modules/mob/living/basic/icemoon/ice_whelp/ice_whelp_abilities.dm +++ b/code/modules/mob/living/basic/icemoon/ice_whelp/ice_whelp_abilities.dm @@ -12,7 +12,8 @@ /datum/action/cooldown/mob_cooldown/ice_breath/Activate(atom/target_atom) var/turf/target_fire_turf = get_ranged_target_turf_direct(owner, target_atom, fire_range) var/list/burn_turfs = get_line(owner, target_fire_turf) - get_turf(owner) - dragon_fire_line(owner, burn_turfs, frozen = TRUE) + // This proc sleeps + INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(dragon_fire_line), owner, /* burn_turfs = */ burn_turfs, /* frozen = */ TRUE) StartCooldown() return TRUE