Weather runtime & EPB fix (#60043)

Fixes the major runtime issue encountered in #60034
Fixes Environmental Protection Bags not protecting from ash storms as they should
This commit is contained in:
Greniza
2021-07-07 13:29:23 -07:00
committed by GitHub
parent c1034abd47
commit 7449247159
2 changed files with 15 additions and 11 deletions
+9 -10
View File
@@ -192,18 +192,17 @@
/datum/weather/proc/can_weather_act(mob/living/mob_to_check)
var/turf/mob_turf = get_turf(mob_to_check)
if(!mob_turf)
return
if(!(mob_turf.z in impacted_z_levels))
if(mob_turf)
return
return
if(!(mob_to_check.loc.z in impacted_z_levels)) // in this case, get_turf(mob_to_check) =/= mob_to_check.loc, so we have to proceed with checking the location's type
return
if(istype(mob_to_check.loc, /obj/structure/closet))
var/obj/structure/closet/current_locker = mob_to_check.loc
if(current_locker.weather_protection)
if((immunity_type in current_locker.weather_protection) || (WEATHER_ALL in current_locker.weather_protection))
return
if(istype(mob_to_check.loc, /obj/structure/closet))
var/obj/structure/closet/current_locker = mob_to_check.loc
if(current_locker.weather_protection)
if((immunity_type in current_locker.weather_protection) || (WEATHER_ALL in current_locker.weather_protection))
return
if((immunity_type in mob_to_check.weather_immunities) || (WEATHER_ALL in mob_to_check.weather_immunities))
return
@@ -72,8 +72,13 @@
return TRUE
if(isliving(L))// if we're a non immune mob inside an immune mob we have to reconsider if that mob is immune to protect ourselves
var/mob/living/the_mob = L
if(WEATHER_ASH in the_mob.weather_immunities)
if((WEATHER_ASH in the_mob.weather_immunities) || (WEATHER_ALL in the_mob.weather_immunities))
return TRUE
if(istype(L, /obj/structure/closet))
var/obj/structure/closet/the_locker = L
if(the_locker.weather_protection)
if((WEATHER_ASH in the_locker.weather_protection) || (WEATHER_ALL in the_locker.weather_protection))
return TRUE
L = L.loc //Check parent items immunities (recurses up to the turf)
return FALSE //RIP you