Skip to content

Commit

Permalink
[MIRROR] Fix Flaky Failure From Fire (#1934)
Browse files Browse the repository at this point in the history
* [MIRROR] Fix Flaky Failure From Fire  (#889)

Fix Flaky Failure From Fire

Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: Bloop <[email protected]>

* Update lava.dm

---------

Co-authored-by: NovaBot <[email protected]>
Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: Bloop <[email protected]>
Co-authored-by: Iajret <[email protected]>
  • Loading branch information
5 people authored Feb 11, 2024
1 parent d93c0dc commit 613bf14
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 0 additions & 2 deletions code/datums/elements/permanent_fire_overlay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 16 additions & 10 deletions code/game/turfs/open/lava.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 613bf14

Please sign in to comment.