From 6265a600e352252d735d2ecf33cfb7c813960d30 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Thu, 7 Jun 2012 02:26:43 -0700 Subject: [PATCH] Made firelocks work right with ZAS. --- code/ZAS/FEA_turf_tile.dm | 4 ++-- code/game/machinery/doors/door.dm | 6 +++++- code/game/machinery/doors/firedoor.dm | 26 +++++++++++++++++++------ code/game/machinery/doors/windowdoor.dm | 6 +++--- code/game/objects/effect_system.dm | 12 ++++++------ 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/code/ZAS/FEA_turf_tile.dm b/code/ZAS/FEA_turf_tile.dm index 2545154075b..b64da4c985c 100644 --- a/code/ZAS/FEA_turf_tile.dm +++ b/code/ZAS/FEA_turf_tile.dm @@ -205,10 +205,10 @@ turf if(zone) zone.rebuild = 1 continue - else if(!CanPass(null, src, 1.5, 1) && CanPass(null, src, 0, 0)) //I normally block air, but am permitting it. + else if(!(T.CanPass(null, src, 1.5, 1) && CanPass(null, T, 1.5, 1)) && (CanPass(null, T, 0, 0) || T.CanPass(null, src, 0, 0))) //I normally block air, but am permitting it. if(zone) //Either open or no doors, air can flow. ZConnect(src,T) //Connect 'em. - else if(!CanPass(null, src, 1.5, 1)) //If I block air, we must look to see if the adjacent turfs need rebuilt. + else if(!(T.CanPass(null, src, 1.5, 1) && CanPass(null, T, 1.5, 1))) //If I block air, we must look to see if the adjacent turfs need rebuilt. if(T.zone && !T.zone.rebuild) for(var/direction2 in cardinal - direction) //Check all other directions for air that might be connected. var/turf/simulated/NT = get_step(src, direction2) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index a6e09072e0b..274eafc5dc2 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -32,7 +32,11 @@ layer = 3.1 //Above most items if closed else layer = 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6 - update_nearby_tiles(need_rebuild=1) + if(world.time < 10) + spawn(10) + update_nearby_tiles(need_rebuild=1) + else + update_nearby_tiles(need_rebuild=1) return diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index efb86ae369e..227fc525aca 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -91,15 +91,29 @@ //border_only fire doors are special when it comes to air groups /obj/machinery/door/firedoor/border_only + New() + ..() + var/turf/simulated/source = get_turf(src) + var/turf/simulated/T = get_step(source,dir) + if(!source.CanPass(null, T, 0, 0) || !locate(/obj/machinery/door/firedoor/border_only) in T) + var/obj/machinery/door/firedoor/F = new(source) + F.name = name + F.desc = desc + F.dir = dir + spawn(0) + del src + CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group) var/direction = get_dir(src,target) - return (dir != direction) + if(direction) + return (dir != direction) + return 1 //It will break the zone when it actually drops, otherwise let it work normally. else if(density) if(!height) var/direction = get_dir(src,target) - return (dir != direction) - else + if(direction) + return (dir != direction) return 0 return 1 @@ -107,9 +121,9 @@ update_nearby_tiles(need_rebuild) if(!air_master) return 0 - var/turf/simulated/source = loc + var/turf/simulated/source = get_turf(src) var/turf/simulated/destination = get_step(source,dir) - if(istype(source)) air_master.tiles_to_update += source - if(istype(destination)) air_master.tiles_to_update += destination + if(istype(source)) air_master.tiles_to_update |= source + if(istype(destination)) air_master.tiles_to_update |= destination return 1 \ No newline at end of file diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 2d093d0f78b..dfa6f2ccb03 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -14,11 +14,11 @@ /obj/machinery/door/window/update_nearby_tiles(need_rebuild) if(!air_master) return 0 - var/turf/simulated/source = loc + var/turf/simulated/source = get_turf(src) var/turf/simulated/target = get_step(source,dir) - if(istype(source)) air_master.tiles_to_update += source - if(istype(target)) air_master.tiles_to_update += target + if(istype(source)) air_master.tiles_to_update |= source + if(istype(target)) air_master.tiles_to_update |= target return 1 diff --git a/code/game/objects/effect_system.dm b/code/game/objects/effect_system.dm index 1232fb0b61b..0d3bbf98ebc 100644 --- a/code/game/objects/effect_system.dm +++ b/code/game/objects/effect_system.dm @@ -1044,17 +1044,17 @@ steam.start() -- spawns the effect proc/update_nearby_tiles(need_rebuild) if(!air_master) return 0 - var/turf/simulated/source = loc + var/turf/simulated/source = get_turf(src) var/turf/simulated/north = get_step(source,NORTH) var/turf/simulated/south = get_step(source,SOUTH) var/turf/simulated/east = get_step(source,EAST) var/turf/simulated/west = get_step(source,WEST) - if(istype(source)) air_master.tiles_to_update += source - if(istype(north)) air_master.tiles_to_update += north - if(istype(south)) air_master.tiles_to_update += south - if(istype(east)) air_master.tiles_to_update += east - if(istype(west)) air_master.tiles_to_update += west + if(istype(source)) air_master.tiles_to_update |= source + if(istype(north)) air_master.tiles_to_update |= north + if(istype(south)) air_master.tiles_to_update |= south + if(istype(east)) air_master.tiles_to_update |= east + if(istype(west)) air_master.tiles_to_update |= west return 1