diff --git a/code/___compile_options.dm b/code/___compile_options.dm index d6cb6bb4233..4349437410b 100644 --- a/code/___compile_options.dm +++ b/code/___compile_options.dm @@ -90,11 +90,17 @@ /// Uncomment to turn on Multi-Z ZAS Support! #define MULTIZAS /// uncomment to enable laggy as sin ZAS debugging systems coded in for when doing bugfixes or major systems overhaulling. -#define ZAS_ASSERTIONS +// #define ZAS_ASSERTIONS /// uncomment to enable *actually* laggy as sin ZAS debugging, like "list in contents". don't do this without a major reason. // #define ZAS_ASSERTIONS_EXPENSIVE /// uncomment to enable debugging graphics. you probably want to keep this off in live! // #define ZAS_DEBUG_GRAPHICS +/// uncomment to enable some otherwise useless hook points for zas debugging +// #define ZAS_BREAKPOINT_HOOKS + +#ifdef ZAS_DEBUG_GRAPHICS + #define ZAS_BREAKPOINT_HOOKS +#endif //! Overlays diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index c2bc6b4a106..20ac3f7f1b3 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -127,9 +127,9 @@ SUBSYSTEM_DEF(air) return else continue + T.turf_flags &= ~TURF_ZONE_REBUILD_QUEUED T.update_air_properties() T.post_update_air_properties() - T.turf_flags &= ~TURF_ZONE_REBUILD_QUEUED #ifdef ZAS_DEBUG_GRAPHICS T.overlays -= mark #endif @@ -144,9 +144,9 @@ SUBSYSTEM_DEF(air) while(selfblock_deferred.len) var/turf/T = selfblock_deferred[selfblock_deferred.len] selfblock_deferred.len-- + T.turf_flags &= ~TURF_ZONE_REBUILD_QUEUED T.update_air_properties() T.post_update_air_properties() - T.turf_flags &= ~TURF_ZONE_REBUILD_QUEUED #ifdef ZAS_DEBUG_GRAPHICS T.overlays -= mark #endif diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 7c693b89240..9b814d4ac5b 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -70,7 +70,7 @@ health = maxhealth update_icon() - update_nearby_tiles(need_rebuild=1) + update_nearby_tiles() /obj/machinery/door/Destroy() density = FALSE @@ -477,15 +477,10 @@ return ..(M) /obj/machinery/door/update_nearby_tiles(need_rebuild) - if(!air_master) - return 0 - for(var/turf/simulated/turf in locs) update_heat_protection(turf) turf.queue_zone_update() - return 1 - /obj/machinery/door/proc/update_heat_protection(var/turf/simulated/source) if(istype(source)) if(src.density && (src.opacity || src.heat_proof)) diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index 75f7f3a20c4..f03b6709009 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -37,7 +37,7 @@ /obj/structure/inflatable/Initialize(mapload) . = ..() - update_nearby_tiles(need_rebuild=1) + update_nearby_tiles() /obj/structure/inflatable/Destroy() update_nearby_tiles() diff --git a/code/game/objects/structures/simple_doors.dm b/code/game/objects/structures/simple_doors.dm index cabcd295b13..fa69704002d 100644 --- a/code/game/objects/structures/simple_doors.dm +++ b/code/game/objects/structures/simple_doors.dm @@ -38,7 +38,7 @@ set_opacity(1) if(material.products_need_process()) START_PROCESSING(SSobj, src) - update_nearby_tiles(need_rebuild=1) + update_nearby_tiles() /obj/structure/simple_door/Destroy() STOP_PROCESSING(SSobj, src) diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index efceab2b58f..e010009834d 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -45,7 +45,7 @@ setDir(NORTH) update_state() - update_nearby_tiles(need_rebuild=1) + update_nearby_tiles() /obj/structure/windoor_assembly/Destroy() density = 0 @@ -280,12 +280,12 @@ to_chat(usr,"It is fastened to the floor; therefore, you can't rotate it!") return 0 if(src.state != "01") - update_nearby_tiles(need_rebuild=1) //Compel updates before + update_nearby_tiles() //Compel updates before src.setDir(turn(src.dir, 270)) if(src.state != "01") - update_nearby_tiles(need_rebuild=1) + update_nearby_tiles() update_icon() return diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 989d37b8c5a..60cf8b5820c 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -184,7 +184,7 @@ /obj/structure/window/setDir(newdir) . = ..() - update_nearby_tiles(need_rebuild = TRUE) + update_nearby_tiles() /obj/structure/window/throw_impacted(atom/movable/AM, datum/thrownthing/TT) . = ..() @@ -398,7 +398,7 @@ health = maxhealth - update_nearby_tiles(need_rebuild = TRUE) + update_nearby_tiles() update_nearby_icons() /obj/structure/window/Destroy() @@ -417,7 +417,7 @@ /obj/structure/window/Moved() . = ..() - update_nearby_tiles(need_rebuild = TRUE) + update_nearby_tiles() //checks if this window is full-tile one /obj/structure/window/proc/is_fulltile() diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 69dab3ae198..8520a4c58d0 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -218,7 +218,8 @@ var/list/debug_verbs = list ( set category = "ZAS" set name = "Check ZAS connections" - if(!check_rights(R_DEBUG)) return + if(!check_rights(R_DEBUG)) + return testZAScolors_remove() var/turf/simulated/location = get_turf(usr) @@ -240,6 +241,9 @@ var/list/debug_verbs = list ( usedZAScolors = 1 testZAScolors_zones += location.zone + if(!location.zone) + to_chat(usr, "No zone in location!") + return for(var/turf/T in location.zone.contents) images += image(green, T,"zasdebug", TURF_LAYER) testZAScolors_turfs += T diff --git a/code/modules/atmospherics/environmental/turf.dm b/code/modules/atmospherics/environmental/turf.dm index 5d2fadbe385..dc61d80aa3c 100644 --- a/code/modules/atmospherics/environmental/turf.dm +++ b/code/modules/atmospherics/environmental/turf.dm @@ -4,6 +4,10 @@ CanAtmosPassVertical = ATMOS_PASS_PROC /// our air mixture, if any - this refers **just** to ours, not our zone. var/datum/gas_mixture/air +#ifdef ZAS_BREAKPOINT_HOOKS + /// verbosity for zas debugging + var/zas_verbose = FALSE +#endif /** * semantically means "we can pass to them", not "they can pass to us" diff --git a/code/modules/atmospherics/environmental/zas/atom.dm b/code/modules/atmospherics/environmental/zas/atom.dm index 85178b393f6..8eb4ae15b16 100644 --- a/code/modules/atmospherics/environmental/zas/atom.dm +++ b/code/modules/atmospherics/environmental/zas/atom.dm @@ -1,12 +1,7 @@ /atom/var/pressure_resistance = ONE_ATMOSPHERE //Convenience function for atoms to update turfs they occupy -/atom/movable/proc/update_nearby_tiles(need_rebuild) - if(!air_master) - return 0 - +/atom/movable/proc/update_nearby_tiles() for(var/turf/simulated/turf in locs) turf.queue_zone_update() - return 1 - diff --git a/code/modules/atmospherics/environmental/zas/turf.dm b/code/modules/atmospherics/environmental/zas/turf.dm index c7fcecc1e12..ac7c4c245f1 100644 --- a/code/modules/atmospherics/environmental/zas/turf.dm +++ b/code/modules/atmospherics/environmental/zas/turf.dm @@ -55,6 +55,12 @@ var/check_dirs = get_zone_neighbours(src) var/unconnected_dirs = check_dirs + //? from: kapu1178 + //src is only connected to the zone by a single direction, this is a safe removal. + if (!(. & (. - 1))) + return TRUE + //? end + #ifdef MULTIZAS var/to_check = GLOB.cornerdirsz #else @@ -87,6 +93,10 @@ . |= dir /turf/simulated/update_air_properties() + #ifdef ZAS_BREAKPOINT_HOOKS + if(zas_verbose) + pass() + #endif if(zone?.invalid) c_copy_air() zone = null //Easier than iterating through the list at the zone. @@ -94,7 +104,7 @@ var/self_block = CanAtmosPass(src, NONE) if(self_block == ATMOS_PASS_AIR_BLOCKED) #ifdef ZAS_DEBUG_GRAPHICS - if(verbose) + if(zas_verbose) to_chat(world, "Self-blocked.") //dbg(blocked) #endif @@ -123,7 +133,7 @@ if(them_to_us == ATMOS_PASS_AIR_BLOCKED) #ifdef ZAS_DEBUG_GRAPHICS - if(verbose) to_chat(world, "[d] is blocked.") + if(zas_verbose) to_chat(world, "[d] is blocked.") //unsim.dbg(air_blocked, turn(180,d)) #endif @@ -133,7 +143,7 @@ if(us_to_them == ATMOS_PASS_AIR_BLOCKED) #ifdef ZAS_DEBUG_GRAPHICS - if(verbose) to_chat(world, "[d] is blocked.") + if(zas_verbose) to_chat(world, "[d] is blocked.") //dbg(air_blocked, d) #endif @@ -142,8 +152,10 @@ if((previously_open & d) && istype(potential, /turf/simulated)) var/turf/simulated/S = potential if(zone && S.zone == zone) + // todo: safely remove? for now the hueristic doesn't seem to work zone.rebuild() - return + // todo: don't do this, just keep going, zone rebuilds shouldn't need this return + return // handle it next cycle, we're done here continue @@ -161,7 +173,7 @@ // we are blocking them and not blocking ourselves - this prevents tiny zones from forming on doorways. if(((them_to_us == ATMOS_PASS_ZONE_BLOCKED) && (us_to_them != ATMOS_PASS_ZONE_BLOCKED)) || ((us_to_them == ATMOS_PASS_ZONE_BLOCKED) && (self_block != ATMOS_PASS_ZONE_BLOCKED))) #ifdef ZAS_DEBUG_GRAPHICS - if(verbose) + if(zas_verbose) to_chat(world, "[d] is zone blocked.") //dbg(zone_blocked, d) #endif @@ -174,23 +186,23 @@ #ifdef ZAS_DEBUG_GRAPHICS dbg(assigned) - if(verbose) to_chat(world, "Added to [zone]") + if(zas_verbose) to_chat(world, "Added to [zone]") #endif else if(S.zone != zone) #ifdef ZAS_DEBUG_GRAPHICS - if(verbose) + if(zas_verbose) to_chat(world, "Connecting to [sim.zone]") #endif air_master.connect(src, potential, min(them_to_us, us_to_them), d) #ifdef ZAS_DEBUG_GRAPHICS - else if(verbose) + else if(zas_verbose) to_chat(world, "[d] has same zone.") - else if(verbose) + else if(zas_verbose) to_chat(world, "[d] has invalid zone.") #endif diff --git a/code/modules/mapping/spawner/_spawner.dm b/code/modules/mapping/spawner/_spawner.dm index ae96caa3d1a..cb5b97af06c 100644 --- a/code/modules/mapping/spawner/_spawner.dm +++ b/code/modules/mapping/spawner/_spawner.dm @@ -1,4 +1,5 @@ /** + * * our only job is to spawn something and then self-delete */ /obj/spawner @@ -22,6 +23,7 @@ /obj/spawner/LateInitialize() Spawn() + qdel(src) /obj/spawner/proc/Spawn() return diff --git a/code/modules/mapping/spawner/window.dm b/code/modules/mapping/spawner/window.dm index fa1bbe7f210..227bd242812 100644 --- a/code/modules/mapping/spawner/window.dm +++ b/code/modules/mapping/spawner/window.dm @@ -13,6 +13,8 @@ var/window_pane_path = /obj/structure/window/basic /// found dirs var/found_dirs = NONE + /// spawn firedoors? fulltile and non-hidden only for now + var/firelocks = FALSE /obj/spawner/window/Initialize(mapload) if(!full_window) @@ -28,7 +30,7 @@ /obj/spawner/window/Spawn() if(spawn_grille) new /obj/structure/grille(loc) - if(!full_window) + if(full_window) new window_full_path(loc) else // spawn in dirs not in found dirs @@ -38,34 +40,67 @@ continue W = new window_pane_path(loc) W.setDir(d) + if(firelocks) + new /obj/machinery/door/firedoor(loc) + +/obj/spawner/window/firelocks + icon_state = "window_grille_pane_fire" /obj/spawner/window/full full_window = TRUE icon_state = "window_grille_full" +/obj/spawner/window/full/firelocks + icon_state = "window_grille_full_fire" + firelocks = TRUE + /obj/spawner/window/reinforced icon_state = "rwindow_grille_pane" window_pane_path = /obj/structure/window/reinforced window_full_path = /obj/structure/window/reinforced/full +/obj/spawner/window/reinforced/firelocks + icon_state = "rwindow_grille_pane_fire" + firelocks = TRUE + /obj/spawner/window/reinforced/full icon_state = "rwindow_grille_full" full_window = TRUE +/obj/spawner/window/reinforced/full/firelocks + icon_state = "rwindow_grille_full_fire" + firelocks = TRUE + /obj/spawner/window/borosillicate icon_state = "phoron_grille_pane" window_pane_path = /obj/structure/window/phoronbasic window_full_path = /obj/structure/window/phoronbasic/full +/obj/spawner/window/borosillicate/firelocks + icon_state = "phoron_grille_pane_fire" + firelocks = TRUE + /obj/spawner/window/borosillicate/full icon_state = "phoron_grille_full" full_window = TRUE +/obj/spawner/window/borosillicate/full/firelocks + icon_state = "phoron_grille_full" + firelocks = TRUE + /obj/spawner/window/borosillicate/reinforced icon_state = "rphoron_grille_pane" window_pane_path = /obj/structure/window/phoronreinforced window_full_path = /obj/structure/window/phoronreinforced/full +/obj/spawner/window/borosillicate/reinforced/firelocks + icon_state = "rphoron_grille_pane_fire" + firelocks = TRUE + /obj/spawner/window/borosillicate/reinforced/full icon_state = "rphoron_grille_full" full_window = TRUE + +/obj/spawner/window/borosillicate/reinforced/full/firelocks + icon_state = "rphoron_grille_full_fire" + firelocks = TRUE diff --git a/code/modules/mob/freelook/update_triggers.dm b/code/modules/mob/freelook/update_triggers.dm index d7a82d973c9..0142f6c6e53 100644 --- a/code/modules/mob/freelook/update_triggers.dm +++ b/code/modules/mob/freelook/update_triggers.dm @@ -33,8 +33,8 @@ // DOORS // Simply updates the visibility of the area when it opens/closes/destroyed. -/obj/machinery/door/update_nearby_tiles(need_rebuild) - . = ..(need_rebuild) +/obj/machinery/door/update_nearby_tiles() + . = ..() // Glass door glass = 1 // don't check then? if(!glass) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 392cd681e79..0f4b8bcfd54 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1112,6 +1112,7 @@ // set species = S + . = TRUE // apply new species, create organs, do post spawn stuff even though we're presumably not spawning half the time // i seriously hate vorecode @@ -1136,6 +1137,7 @@ species.create_blood(src) species.handle_post_spawn(src) species.update_attack_types() // Required for any trait that updates unarmed_types in setup. + updatehealth() // uh oh stinky - some species just have more/less maxhealth, this is a shit fix imo but deal with it for now ~silicons // Rebuild the HUD. If they aren't logged in then login() should reinstantiate it for them. update_hud() diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/space/worm.dm b/code/modules/mob/living/simple_mob/subtypes/animal/space/worm.dm index c2c89130031..afb5cab84a7 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/space/worm.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/space/worm.dm @@ -309,7 +309,7 @@ EF.visible_message("\The [EF] reverberates as it returns to normal.") if(objectOrMob) - objectOrMob.update_nearby_tiles(need_rebuild=1) + objectOrMob.update_nearby_tiles() objectOrMob.forceMove(src) return 1 diff --git a/code/modules/overmap/ships/engines/gas_thruster.dm b/code/modules/overmap/ships/engines/gas_thruster.dm index f4635219c98..6978121b358 100644 --- a/code/modules/overmap/ships/engines/gas_thruster.dm +++ b/code/modules/overmap/ships/engines/gas_thruster.dm @@ -82,7 +82,7 @@ /obj/machinery/atmospherics/component/unary/engine/Initialize(mapload) . = ..() controller = new(src) - update_nearby_tiles(need_rebuild=1) + update_nearby_tiles() if(SSshuttle.initialized) link_to_ship() diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index 083cd070d5d..3d2ed5b9dca 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -31,7 +31,7 @@ /obj/machinery/shield/Initialize(mapload) . = ..() setDir(pick(1,2,3,4)) - update_nearby_tiles(need_rebuild=1) + update_nearby_tiles() /obj/machinery/shield/Destroy() opacity = 0 diff --git a/icons/mapping/spawners/windows.dmi b/icons/mapping/spawners/windows.dmi index 07a9731a7ed..ab1dbf45809 100644 Binary files a/icons/mapping/spawners/windows.dmi and b/icons/mapping/spawners/windows.dmi differ