From 613bf14ae5fe485746227a571f4365dd03fff15b Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Mon, 12 Feb 2024 00:15:34 +0300 Subject: [PATCH] [MIRROR] Fix Flaky Failure From Fire (#1934) * [MIRROR] Fix Flaky Failure From Fire (#889) Fix Flaky Failure From Fire Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> * Update lava.dm --------- Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Iajret --- .../datums/elements/permanent_fire_overlay.dm | 2 -- code/game/turfs/open/lava.dm | 26 ++++++++++++------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/code/datums/elements/permanent_fire_overlay.dm b/code/datums/elements/permanent_fire_overlay.dm index e4a61852aed..514d0f121a4 100644 --- a/code/datums/elements/permanent_fire_overlay.dm +++ b/code/datums/elements/permanent_fire_overlay.dm @@ -8,12 +8,10 @@ RegisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(add_fire_overlay)) target.update_appearance(UPDATE_OVERLAYS) - ADD_TRAIT(target, TRAIT_NO_EXTINGUISH, ELEMENT_TRAIT(type)) /datum/element/perma_fire_overlay/Detach(atom/target) . = ..() UnregisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS) - REMOVE_TRAIT(target, TRAIT_NO_EXTINGUISH, ELEMENT_TRAIT(type)) target.update_appearance(UPDATE_OVERLAYS) /datum/element/perma_fire_overlay/proc/add_fire_overlay(mob/living/source, list/overlays) diff --git a/code/game/turfs/open/lava.dm b/code/game/turfs/open/lava.dm index 30bed8fc87c..8f9e7b44aa6 100644 --- a/code/game/turfs/open/lava.dm +++ b/code/game/turfs/open/lava.dm @@ -53,6 +53,7 @@ /turf/open/lava/Destroy() for(var/mob/living/leaving_mob in contents) leaving_mob.RemoveElement(/datum/element/perma_fire_overlay) + REMOVE_TRAIT(leaving_mob, TRAIT_NO_EXTINGUISH, TURF_TRAIT) return ..() /turf/open/lava/update_overlays() @@ -145,6 +146,7 @@ . = ..() if(isliving(gone) && !islava(gone.loc)) gone.RemoveElement(/datum/element/perma_fire_overlay) + REMOVE_TRAIT(gone, TRAIT_NO_EXTINGUISH, TURF_TRAIT) /turf/open/lava/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) if(burn_stuff(AM)) @@ -292,11 +294,10 @@ if(QDELETED(burn_target)) return FALSE - . = TRUE if(isobj(burn_target)) var/obj/burn_obj = burn_target if(burn_obj.resistance_flags & ON_FIRE) // already on fire; skip it. - return + return TRUE if(!(burn_obj.resistance_flags & FLAMMABLE)) burn_obj.resistance_flags |= FLAMMABLE //Even fireproof things burn up in lava if(burn_obj.resistance_flags & FIRE_PROOF) @@ -305,16 +306,21 @@ burn_obj.set_armor_rating(FIRE, 50) burn_obj.fire_act(temperature_damage, 1000 * seconds_per_tick) if(istype(burn_obj, /obj/structure/closet)) - var/obj/structure/closet/burn_closet = burn_obj - for(var/burn_content in burn_closet.contents) + for(var/burn_content in burn_target) burn_stuff(burn_content) - return + return TRUE - var/mob/living/burn_living = burn_target - burn_living.AddElement(/datum/element/perma_fire_overlay) - burn_living.ignite_mob() - burn_living.adjust_fire_stacks(lava_firestacks * seconds_per_tick) - burn_living.adjustFireLoss(lava_damage * seconds_per_tick) + if(isliving(burn_target)) + var/mob/living/burn_living = burn_target + if(!HAS_TRAIT_FROM(burn_living, TRAIT_NO_EXTINGUISH, TURF_TRAIT)) + burn_living.AddElement(/datum/element/perma_fire_overlay) + ADD_TRAIT(burn_living, TRAIT_NO_EXTINGUISH, TURF_TRAIT) + burn_living.adjust_fire_stacks(lava_firestacks * seconds_per_tick) + burn_living.ignite_mob() + burn_living.adjustFireLoss(lava_damage * seconds_per_tick) + return TRUE + + return FALSE /turf/open/lava/can_cross_safely(atom/movable/crossing) return HAS_TRAIT(src, TRAIT_LAVA_STOPPED) || HAS_TRAIT(crossing, immunity_trait ) || HAS_TRAIT(crossing, TRAIT_MOVE_FLYING)