Files
Aurora.3/code/__defines/ZAS.dm
Lohikar 8af0051fd6 More macros (#2955)
changes:

Holomaps now use an area flag instead of a proc to determine which areas do not draw on the holomap.
The supply shuttle once more has a roof.
The supply shuttle's landing zone is now dynamically lit.
Turfs only generate visibility updates on Initialize() after mapload - visualnet is not initialized by then anyways.
Merged /datum/gas_mixture/(init) into /datum/gas_mixture/New().
Converted a ZAS proc into a macro.
Made ZAS attempt to remove a turf from a zone instead of always rebuilding it in a certain case.
Macroized two misc procs.
Fixes #2947.
2017-07-06 23:37:58 +03:00

103 lines
2.1 KiB
Plaintext

//#define ZASDBG
#define MULTIZAS
#define AIR_BLOCKED 1
#define ZONE_BLOCKED 2
#define BLOCKED 3
#define ZONE_MIN_SIZE 14 //zones with less than this many turfs will always merge, even if the connection is not direct
#define CANPASS_ALWAYS 1
#define CANPASS_DENSITY 2
#define CANPASS_PROC 3
#define CANPASS_NEVER 4
#define TURF_HAS_VALID_ZONE(T) (istype(T, /turf/simulated) && T:zone && !T:zone:invalid)
#ifdef MULTIZAS
#define ATMOS_CANPASS_TURF(ret,A,B) \
if (A.blocks_air & AIR_BLOCKED || B.blocks_air & AIR_BLOCKED) { \
ret = BLOCKED; \
} \
else if (B.z != A.z) { \
if (B.z < A.z) { \
if (!isopenturf(A)) { \
ret = BLOCKED; \
} else { \
ret = ZONE_BLOCKED; \
} \
} \
else { \
if (!isopenturf(B)) { \
ret = BLOCKED; \
} else { \
ret = ZONE_BLOCKED; \
} \
} \
} \
else if (A.blocks_air & ZONE_BLOCKED || B.blocks_air & ZONE_BLOCKED) { \
ret = (A.z == B.z) ? ZONE_BLOCKED : AIR_BLOCKED; \
} \
else if (A.contents.len) { \
ret = 0;\
for (var/thing in A) { \
var/atom/movable/AM = thing; \
switch (AM.atmos_canpass) { \
if (CANPASS_ALWAYS) { \
continue; \
} \
if (CANPASS_DENSITY) { \
if (AM.density) { \
ret |= AIR_BLOCKED; \
} \
} \
if (CANPASS_PROC) { \
ret |= AM.c_airblock(B); \
} \
if (CANPASS_NEVER) { \
ret = BLOCKED; \
} \
} \
if (ret == BLOCKED) { \
break;\
}\
}\
}
#else
#define ATMOS_CANPASS_TURF(ret,A,B) \
if (A.blocks_air & AIR_BLOCKED || B.blocks_air & AIR_BLOCKED) { \
ret = BLOCKED; \
} \
else if (A.blocks_air & ZONE_BLOCKED || B.blocks_air & ZONE_BLOCKED) { \
ret = ZONE_BLOCKED; \
} \
else if (A.contents.len) { \
ret = 0;\
for (var/thing in A) { \
var/atom/movable/AM = thing; \
switch (AM.atmos_canpass) { \
if (CANPASS_ALWAYS) { \
continue; \
} \
if (CANPASS_DENSITY) { \
if (AM.density) { \
ret |= AIR_BLOCKED; \
} \
} \
if (CANPASS_PROC) { \
ret |= AM.c_airblock(B); \
} \
if (CANPASS_NEVER) { \
ret = BLOCKED; \
} \
} \
if (ret == BLOCKED) { \
break;\
}\
}\
}
#endif