mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Much better solution to the zone geometry bug.
Adds a unsim_check_directions var to simulated turfs, which is similar in use to air_check_directions but points to unsimulated or space tiles instead of open air tiles. Signed-off-by: Mloc <colmohici@gmail.com>
This commit is contained in:
@@ -43,6 +43,8 @@
|
||||
|
||||
/turf/simulated/var/tmp/air_check_directions = 0 //Do not modify this, just add turf to air_master.tiles_to_update
|
||||
|
||||
/turf/simulated/var/tmp/unsim_check_directions = 0 //See above.
|
||||
|
||||
/turf/simulated/var/tmp/obj/fire/active_hotspot
|
||||
|
||||
/turf/simulated/proc/update_visuals()
|
||||
@@ -125,11 +127,19 @@
|
||||
return ..()
|
||||
|
||||
/turf/simulated/proc/update_air_properties()
|
||||
var/air_directions_archived = air_check_directions
|
||||
air_check_directions = 0
|
||||
|
||||
var/unsim_directions_archived = unsim_check_directions
|
||||
unsim_check_directions = 0
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(ZAirPass(get_step(src,direction)))
|
||||
var/turf/check_turf = get_step(src, direction)
|
||||
if(ZAirPass(check_turf))
|
||||
if(istype(check_turf, /turf/simulated))
|
||||
air_check_directions |= direction
|
||||
else if(istype(check_turf, /turf/space) || istype(check_turf, /turf/unsimulated))
|
||||
unsim_check_directions |= direction
|
||||
|
||||
if(!zone && !blocks_air) //No zone, but not a wall.
|
||||
for(var/direction in DoorDirections) //Check door directions first.
|
||||
@@ -164,12 +174,15 @@
|
||||
var/turf/T = get_step(src,direction)
|
||||
if(!istype(T))
|
||||
continue
|
||||
//I can connect to air in this direction
|
||||
if(air_check_directions & direction)
|
||||
|
||||
//I can connect to air or space in this direction
|
||||
if((air_check_directions & direction && !(air_directions_archived & direction)) || \
|
||||
(unsim_check_directions & direction && !(unsim_directions_archived & direction)))
|
||||
ZConnect(src,T)
|
||||
|
||||
//Something like a wall was built, changing the geometry.
|
||||
else if(!(air_check_directions & direction))
|
||||
else if((!(air_check_directions & direction) && air_directions_archived & direction) || \
|
||||
(!(unsim_check_directions & direction) && unsim_directions_archived & direction))
|
||||
var/turf/NT = get_step(T, direction)
|
||||
|
||||
//If the tile is in our own zone, and we cannot connect to it, better rebuild.
|
||||
|
||||
Reference in New Issue
Block a user