Made firelocks work right with ZAS.

This commit is contained in:
SkyMarshal
2012-06-07 03:14:14 -07:00
parent 32c0c5c625
commit 6265a600e3
5 changed files with 36 additions and 18 deletions
+2 -2
View File
@@ -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)
+5 -1
View File
@@ -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
+20 -6
View File
@@ -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
+3 -3
View File
@@ -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
+6 -6
View File
@@ -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