From 5b42b1ffd8e73a0a289e8c1109050df6b4dc66e8 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Sun, 30 Mar 2025 13:59:32 -0700 Subject: [PATCH] [MIRROR] ignore light recalc in shuttles and elevators (#10559) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- code/__defines/is_helpers.dm | 4 ++-- code/game/objects/items/weapons/inducer_vr.dm | 2 +- code/game/objects/structures/lattice.dm | 2 +- code/game/turfs/simulated/floor_attackby.dm | 2 +- code/game/turfs/simulated/wall_attacks.dm | 2 +- code/game/turfs/space/space.dm | 2 +- code/game/turfs/turf_changing.dm | 14 ++++++++------ code/modules/events/meteor_strike_vr.dm | 2 +- code/modules/hydroponics/spreading/spreading.dm | 16 ++++++---------- .../hydroponics/spreading/spreading_growth.dm | 4 ++-- code/modules/hydroponics/trays/tray_soil.dm | 6 ++---- code/modules/lighting/sunlight_handler.dm | 2 +- code/modules/shieldgen/shield_generator.dm | 2 +- 13 files changed, 28 insertions(+), 32 deletions(-) diff --git a/code/__defines/is_helpers.dm b/code/__defines/is_helpers.dm index 5bd4a68a53..31eebed78b 100644 --- a/code/__defines/is_helpers.dm +++ b/code/__defines/is_helpers.dm @@ -67,8 +67,8 @@ //#define isturf(D) istype(D, /turf) //Built in #define isopenspace(A) istype(A, /turf/simulated/open) #define isspace(A) istype(A, /turf/space) -#define isopenturf(A) istype(A, /turf/simulated/open) || istype(A, /turf/space) -#define isnonsolidturf(A) istype(A, /turf/simulated/open) || istype(A, /turf/space) || istype(A, /turf/simulated/floor/water) || istype(A, /turf/simulated/floor/lava) +#define isopenturf(A) (istype(A, /turf/simulated/open) || istype(A, /turf/space)) +#define isnonsolidturf(A) (istype(A, /turf/simulated/open) || istype(A, /turf/space) || istype(A, /turf/simulated/floor/water) || istype(A, /turf/simulated/floor/lava)) #define ismineralturf(A) istype(A, /turf/simulated/mineral) #define istaurtail(A) istype(A, /datum/sprite_accessory/tail/taur) diff --git a/code/game/objects/items/weapons/inducer_vr.dm b/code/game/objects/items/weapons/inducer_vr.dm index 4a99c605a8..842c785a47 100644 --- a/code/game/objects/items/weapons/inducer_vr.dm +++ b/code/game/objects/items/weapons/inducer_vr.dm @@ -258,9 +258,9 @@ var/mob/living/carbon/human/hume /obj/item/cell/standin/Initialize(mapload, var/mob/living/carbon/human/H) + . = ..() if(!istype(H)) return INITIALIZE_HINT_QDEL - . = ..() hume = H charge = H.nutrition maxcharge = initial(H.nutrition) diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 01866cf67c..5898416d64 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -11,7 +11,7 @@ /obj/structure/lattice/Initialize(mapload) . = ..() - if(!(istype(src.loc, /turf/space) || istype(src.loc, /turf/simulated/open) || istype(src.loc, /turf/simulated/mineral) || istype(src.loc, /turf/simulated/shuttle/plating/airless/carry))) + if(!(isopenturf(src.loc) || istype(src.loc, /turf/simulated/mineral) || istype(src.loc, /turf/simulated/shuttle/plating/airless/carry))) return INITIALIZE_HINT_QDEL for(var/obj/structure/lattice/LAT in src.loc) diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index d4c4a71a18..59a34dd3cb 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -20,7 +20,7 @@ // Patch holes in the ceiling if(T) - if(istype(T, /turf/simulated/open) || istype(T, /turf/space)) + if(isopenturf(T)) // Must be build adjacent to an existing floor/wall, no floating floors var/list/cardinalTurfs = list() // Up a Z level for(var/dir in cardinal) diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index f90fc29a2c..1b1bd0656c 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -170,7 +170,7 @@ // Place plating over a wall if(T) - if(istype(T, /turf/simulated/open) || istype(T, /turf/space)) + if(isopenturf(T)) if(R.use(1)) // Cost of roofing tiles is 1:1 with cost to place lattice and plating T.ReplaceWithLattice() T.ChangeTurf(/turf/simulated/floor, preserve_outdoors = TRUE) diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 98c2c18715..e5d749c3f6 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -113,7 +113,7 @@ // Patch holes in the ceiling if(T) - if(istype(T, /turf/simulated/open) || istype(T, /turf/space)) + if(isopenturf(T)) // Must be build adjacent to an existing floor/wall, no floating floors var/turf/simulated/A = locate(/turf/simulated/floor) in T.CardinalTurfs() if(!A) diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 41f87b30f8..262ac48fee 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -51,7 +51,7 @@ var/old_dynamic_lumcount = dynamic_lumcount var/oldtype = src.type var/old_density = src.density - var/was_open = istype(src,/turf/simulated/open) + var/was_open = isopenturf(src) var/datum/sunlight_handler/old_shandler var/turf/simulated/simself = src if(istype(simself) && simself.shandler) @@ -141,24 +141,26 @@ if(SUNLIGHT_ONLY_SHADE) vis_contents += sim_self.shandler.pshandler.vis_shade - var/is_open = istype(W,/turf/simulated/open) + var/is_open = isopenturf(W) - propogate_sunlight_changes(oldtype, old_density, W) var/turf/simulated/cur_turf = src if(istype(cur_turf)) + var/area/A = cur_turf.loc + if(is_outdoors() && !A.isAlwaysIndoors()) + propogate_sunlight_changes(oldtype, old_density, W) if(is_open != was_open) do cur_turf = GetBelow(cur_turf) if(!istype(cur_turf, /turf/simulated)) break - var/area/A = cur_turf.loc + A = cur_turf.loc if(is_open && !A.isAlwaysIndoors()) cur_turf.make_outdoors() + cur_turf.propogate_sunlight_changes(oldtype, old_density, W, above = TRUE) else cur_turf.make_indoors() - cur_turf.propogate_sunlight_changes(oldtype, old_density, W, above = TRUE) - while(istype(cur_turf,/turf/simulated/open) && HasBelow(cur_turf.z)) + while(isopenturf(cur_turf) && HasBelow(cur_turf.z)) if(old_shandler) old_shandler.holder_change() if(preserve_outdoors) diff --git a/code/modules/events/meteor_strike_vr.dm b/code/modules/events/meteor_strike_vr.dm index fde70c8d5b..c2f23a9e90 100644 --- a/code/modules/events/meteor_strike_vr.dm +++ b/code/modules/events/meteor_strike_vr.dm @@ -30,7 +30,7 @@ /obj/effect/meteor_falling/proc/meteor_fall() var/turf/current = get_turf(src) - if(istype(current, /turf/simulated/open) || istype(current, /turf/space)) + if(isopenturf(current)) var/turf/below = GetBelow(src) if(below.density) meteor_impact() diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index 9380a1afd7..65e2a4aa84 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -83,31 +83,27 @@ /obj/effect/plant/single spread_chance = 0 -/obj/effect/plant/New(var/newloc, var/datum/seed/newseed, var/obj/effect/plant/newparent) +/obj/effect/plant/Initialize(mapload, var/datum/seed/newseed, var/obj/effect/plant/newparent) + . = ..() //VOREStation Edit Start - if(istype(loc, /turf/simulated/open)) - qdel(src) + if(isopenturf(loc)) + return INITIALIZE_HINT_QDEL //VOREStation Edit End - ..() if(!newparent) parent = src else parent = newparent - if(!SSplants) - sleep(250) // ugly hack, should mean roundstart plants are fine. TODO initialize perhaps? if(!SSplants) to_world(span_danger("Plant controller does not exist and [src] requires it. Aborting.")) - qdel(src) - return + return INITIALIZE_HINT_QDEL if(!istype(newseed)) newseed = SSplants.seeds[DEFAULT_SEED] seed = newseed if(!seed) - qdel(src) - return + return INITIALIZE_HINT_QDEL name = seed.display_name max_health = round(seed.get_trait(TRAIT_ENDURANCE)/2) diff --git a/code/modules/hydroponics/spreading/spreading_growth.dm b/code/modules/hydroponics/spreading/spreading_growth.dm index 7c03046c93..78c2f5948e 100644 --- a/code/modules/hydroponics/spreading/spreading_growth.dm +++ b/code/modules/hydroponics/spreading/spreading_growth.dm @@ -5,7 +5,7 @@ for(var/check_dir in cardinal) var/turf/simulated/T = get_step(get_turf(src), check_dir) //VOREStation Edit Start - Vines can go up/down stairs, but don't register that they have done this, so do so infinitely, which is annoying and laggy. - if(istype(T) && !istype(check_dir, /turf/simulated/open)) //Let's not have them go on open space where you can't really get to them. + if(istype(T) && !isopenturf(check_dir)) //Let's not have them go on open space where you can't really get to them. cardinal_neighbors |= T //VOREStation Edit End return cardinal_neighbors @@ -122,7 +122,7 @@ //Instead, they are created at their parent and then move to their destination. /obj/effect/plant/proc/spread_to(turf/target_turf) //VOREStation Edit Start - Vines can go up/down stairs, but don't register that they have done this, so do so infinitely, which is annoying and laggy. - if(istype(target_turf, /turf/simulated/open)) + if(isopenturf(target_turf)) return //VOREStation Edit End var/obj/effect/plant/child = new(get_turf(src),seed,parent) diff --git a/code/modules/hydroponics/trays/tray_soil.dm b/code/modules/hydroponics/trays/tray_soil.dm index 000fa68fe3..731d8ff75d 100644 --- a/code/modules/hydroponics/trays/tray_soil.dm +++ b/code/modules/hydroponics/trays/tray_soil.dm @@ -51,11 +51,9 @@ icon_state = "blank" /obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Initialize(mapload,var/datum/seed/newseed) - //VOREStation Addition Start - if(istype(loc, /turf/simulated/open) || istype(loc, /turf/space)) - return INITIALIZE_HINT_QDEL - //VOREStation Addition End . = ..() + if(isopenturf(loc)) + return INITIALIZE_HINT_QDEL seed = newseed dead = 0 age = 1 diff --git a/code/modules/lighting/sunlight_handler.dm b/code/modules/lighting/sunlight_handler.dm index ce286143e5..26a6bfac8f 100644 --- a/code/modules/lighting/sunlight_handler.dm +++ b/code/modules/lighting/sunlight_handler.dm @@ -19,7 +19,7 @@ if(((SSplanets && SSplanets.z_to_planet.len >= z && SSplanets.z_to_planet[z]) || SSlighting.get_pshandler_z(z)) && has_dynamic_lighting()) //Only for planet turfs or fakesuns that specify they want to use this system if(is_outdoors()) var/turf/T = GetAbove(src) - if(T && !istype(T,/turf/simulated/open)) + if(T && !isopenturf(T) && (SSplanets.z_to_planet.len >= T.z && SSplanets.z_to_planet[T.z])) make_indoors() if(!shandler_noinit) shandler = new(src) diff --git a/code/modules/shieldgen/shield_generator.dm b/code/modules/shieldgen/shield_generator.dm index 8001612907..da67ce549f 100644 --- a/code/modules/shieldgen/shield_generator.dm +++ b/code/modules/shieldgen/shield_generator.dm @@ -651,7 +651,7 @@ var/area/TA = null // Variable for area checking. Defining it here so memory does not have to be allocated repeatedly. for(var/turf/T in trange(field_radius, gen_turf)) // Don't expand to space or on shuttle areas. - if(istype(T, /turf/space) || istype(T, /turf/simulated/open)) + if(isopenturf(T)) continue // Find adjacent space/shuttle tiles and cover them. Shuttles won't be blocked if shield diffuser is mapped in and turned on.