From e10d0a02fe97eb7b86e5af926f59a8cb20b19c19 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 19 Aug 2021 18:33:43 -0500 Subject: [PATCH] Fix fire exploit being extinguished by pAIs, borgs, and simple animals (#60852) * Fix fire being extinguished by pAIs, borgs, and simple animals * Add trait TRAIT_NOFIRE_SPREAD * Add NOFIRE_SPREAD traits to simple and silicon mob types * Refactor spreadFire proc to use check TRAIT_NOFIRE_SPREAD --- code/__DEFINES/traits.dm | 1 + code/modules/mob/living/living.dm | 4 ++++ code/modules/mob/living/silicon/silicon.dm | 1 + code/modules/mob/living/simple_animal/simple_animal.dm | 1 + 4 files changed, 7 insertions(+) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 198ed7f718e..0cd36bbe6b0 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -199,6 +199,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_PIERCEIMMUNE "pierce_immunity" #define TRAIT_NODISMEMBER "dismember_immunity" #define TRAIT_NOFIRE "nonflammable" +#define TRAIT_NOFIRE_SPREAD "no_fire_spreading" #define TRAIT_NOGUNS "no_guns" #define TRAIT_NOHUNGER "no_hunger" #define TRAIT_NOMETABOLISM "no_metabolism" diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 53c53ca514c..59c2302ef3c 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1442,6 +1442,10 @@ if(!istype(L)) return + // can't spread fire to mobs that don't catch on fire + if(HAS_TRAIT(L, TRAIT_NOFIRE_SPREAD) || HAS_TRAIT(src, TRAIT_NOFIRE_SPREAD)) + return + if(on_fire) if(L.on_fire) // If they were also on fire var/firesplit = (fire_stacks + L.fire_stacks)/2 diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index e9c02033d48..79162d2c7a2 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -59,6 +59,7 @@ add_sensors() ADD_TRAIT(src, TRAIT_ADVANCEDTOOLUSER, ROUNDSTART_TRAIT) ADD_TRAIT(src, TRAIT_MARTIAL_ARTS_IMMUNE, ROUNDSTART_TRAIT) + ADD_TRAIT(src, TRAIT_NOFIRE_SPREAD, SPECIES_TRAIT) /mob/living/silicon/Destroy() QDEL_NULL(radio) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index a911672ae1f..a3d416cc443 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -178,6 +178,7 @@ AddComponent(/datum/component/personal_crafting) ADD_TRAIT(src, TRAIT_ADVANCEDTOOLUSER, ROUNDSTART_TRAIT) ADD_TRAIT(src, TRAIT_CAN_STRIP, ROUNDSTART_TRAIT) + ADD_TRAIT(src, TRAIT_NOFIRE_SPREAD, SPECIES_TRAIT) if(speak) speak = string_list(speak)