isopenturf() macro, update_above improvements (#2931)

changes:

Added a isopenturf() macro, equivalent to istype(thing, /turf/simulated/open).
Converted most/all instances of istype(/turf/simulated/open) to isopenturf().
Made update_above()' aware of queue status & inlined a proc-call.
This commit is contained in:
Lohikar
2017-07-03 04:04:18 -05:00
committed by skull132
parent d0fcc77f31
commit 9c010f92d1
18 changed files with 29 additions and 33 deletions

View File

@@ -78,10 +78,10 @@
// Invokes fall_through() after the atom is moved to
// its new destination this cycle. Immediately invokes fall_impact and
// fall_collateral if the next turf is not open space.
if (istype(victim.loc, /turf/simulated/open))
if (isopenturf(victim.loc))
victim.forceMove(below)
if (istype(victim.loc, /turf/simulated/open))
if (isopenturf(victim.loc))
victim.fall_through()
else
// This is a lookahead. It removes any lag from being moved onto

View File

@@ -2,7 +2,7 @@
// Seems to be much simpler/saner than /vg/'s implementation.
// Turfs that will be colored as HOLOMAP_ROCK
#define IS_ROCK(tile) (istype(tile, /turf/simulated/mineral) || istype(tile, /turf/simulated/floor/asteroid) || istype(tile, /turf/simulated/open))
#define IS_ROCK(tile) (istype(tile, /turf/simulated/mineral) || istype(tile, /turf/simulated/floor/asteroid) || isopenturf(tile))
// Turfs that will be colored as HOLOMAP_OBSTACLE
#define IS_OBSTACLE(tile) ((!istype(tile, /turf/space) && istype(tile.loc, /area/mine/unexplored)) \

View File

@@ -195,6 +195,6 @@
/datum/controller/subsystem/openturf/proc/calculate_depth(turf/simulated/open/T)
. = 0
while (T && istype(T.below, /turf/simulated/open))
while (T && isopenturf(T.below))
T = T.below
.++