Fixed some bugs with ZAS closed connections

Sped up air equalization between zones
Fixed an issue where space tiles were not removed from the zone.
Made ZAS debug functions accessible when the mapping verbs are toggled on.
This commit is contained in:
SkyMarshal
2013-04-18 12:10:20 -07:00
parent 846a8ec906
commit ef38bc91bf
7 changed files with 46 additions and 9 deletions

View File

@@ -1301,6 +1301,7 @@
#include "code\WorkInProgress\virus2\isolator.dm"
#include "code\ZAS\Airflow.dm"
#include "code\ZAS\Connection.dm"
#include "code\ZAS\Debug.dm"
#include "code\ZAS\FEA_gas_mixture.dm"
#include "code\ZAS\FEA_system.dm"
#include "code\ZAS\Fire.dm"

View File

@@ -66,6 +66,9 @@ connection
B.zone.connected_zones += A.zone
B.zone.connected_zones[A.zone] = 1
if(A.HasDoor(B) || B.HasDoor(A))
indirect = CONNECTION_INDIRECT
else
indirect = CONNECTION_CLOSED
@@ -86,8 +89,6 @@ connection
B.zone.closed_connection_zones += A.zone
B.zone.closed_connection_zones[A.zone] = 1
if(A.HasDoor(B) || B.HasDoor(A))
indirect = CONNECTION_INDIRECT
else
world.log << "Attempted to create connection object for non-zone tiles: [T] -> [O]"
del(src)

View File

@@ -1,5 +1,5 @@
client/verb/Zone_Info(turf/T as null|turf)
client/proc/Zone_Info(turf/T as null|turf)
set category = "Debug"
if(T)
if(T.zone)
@@ -14,7 +14,7 @@ client/verb/Zone_Info(turf/T as null|turf)
client/verb/Test_ZAS_Connection(var/turf/simulated/T as turf)
client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf)
set category = "Debug"
if(!istype(T))
return

View File

@@ -109,6 +109,7 @@ proc/ZMerge(zone/A,zone/B)
proc/ZConnect(turf/simulated/A,turf/simulated/B)
//Connects two zones by forming a connection object representing turfs A and B.
//Make sure that if it's space, it gets added to unsimulated_tiles instead.
if(!istype(B))
if(A.zone)

View File

@@ -181,9 +181,41 @@ turf
// var/list/zone/adjacent_zones = list()
if(air_check_directions&direction) //I can connect air in this direction
if(!CanPass(null, T, 0, 0)) //If either block air from a door
if(!CanPass(null, src, 0, 0)) //I block air, so I have a door. Forge a closed connection through me.
ZConnect(src, T)
if(!CanPass(null, T, 0, 0)) //If either block air, we must look to see if the adjacent turfs need rebuilt.
if(!T.CanPass(null, T, 0, 0)) //Target blocks air
var/turf/NT = get_step(T, direction)
if(istype(NT,/turf/simulated) && NT in zone.contents)
air_master.AddToConsiderRebuild(src,NT)
else if(istype(NT) && NT in zone.unsimulated_tiles)
var/consider_rebuild = 0
for(var/d in cardinal)
var/turf/UT = get_step(NT,d)
if(istype(UT, /turf/simulated) && UT.zone == zone && UT.CanPass(null, NT, 0, 0)) //If we find a neighboring tile that is in the same zone, check if we need to rebuild
consider_rebuild = 1
break
if(consider_rebuild)
air_master.AddToConsiderRebuild(src,NT) //Gotta check if we need to rebuild, dammit
else
zone.RemoveTurf(NT) //Not adjacent to anything, and unsimulated. Goodbye~
//To make a closed connection through closed door.
ZConnect(T, src)
if(T.zone && !T.zone.rebuild) //I block air.
var/turf/NT = get_step(src, reverse_direction(direction))
if(istype(NT,/turf/simulated) && (NT in T.zone.contents || (NT.zone && T in NT.zone.contents)))
air_master.AddToConsiderRebuild(T,NT)
else if(istype(NT) && NT in T.zone.unsimulated_tiles)
var/consider_rebuild = 0
for(var/d in cardinal)
var/turf/UT = get_step(NT,d)
if(istype(UT, /turf/simulated) && UT.zone == T.zone && UT.CanPass(null, NT, 0, 0)) //If we find a neighboring tile that is in the same zone, check if we need to rebuild
consider_rebuild = 1
break
if(consider_rebuild)
air_master.AddToConsiderRebuild(T,NT) //Gotta check if we need to rebuild, dammit
else
T.zone.RemoveTurf(NT) //Not adjacent to anything, and unsimulated. Goodbye~
else
ZConnect(src,T)

View File

@@ -274,7 +274,7 @@ zone/proc/process()
for(var/zone/Z in closed_connection_zones)
if(air && Z.air)
if( abs(air.temperature - Z.air.temperature) > 50 )
if( abs(air.temperature - Z.air.temperature) > 10 )
ShareHeat(air, Z.air, closed_connection_zones[Z])
progress = "all components completed successfully, the problem is not here"
@@ -283,7 +283,7 @@ zone/proc/process()
//Air Movement//
////////////////
var/list/sharing_lookup_table = list(0.08, 0.15, 0.21, 0.26, 0.30, 0.33)
var/list/sharing_lookup_table = list(0.15, 0.20, 0.24, 0.27, 0.30, 0.33)
proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
//Shares a specific ratio of gas between mixtures using simple weighted averages.

View File

@@ -159,6 +159,8 @@ var/intercom_range_display_status = 0
src.verbs += /client/proc/kill_air_processing
src.verbs += /client/proc/disable_communication
src.verbs += /client/proc/disable_movement
src.verbs += /client/proc/Zone_Info
src.verbs += /client/proc/Test_ZAS_Connection
//src.verbs += /client/proc/cmd_admin_rejuvenate
feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!