mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-24 17:11:22 +00:00
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:
@@ -58,9 +58,9 @@ turf/c_airblock(turf/other)
|
|||||||
#ifdef MULTIZAS
|
#ifdef MULTIZAS
|
||||||
if(other.z != src.z)
|
if(other.z != src.z)
|
||||||
if(other.z < src.z)
|
if(other.z < src.z)
|
||||||
if(!istype(src, /turf/simulated/open)) return BLOCKED
|
if(!isopenturf(src)) return BLOCKED
|
||||||
else
|
else
|
||||||
if(!istype(other, /turf/simulated/open)) return BLOCKED
|
if(!isopenturf(other)) return BLOCKED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(((blocks_air & ZONE_BLOCKED) || (other.blocks_air & ZONE_BLOCKED)))
|
if(((blocks_air & ZONE_BLOCKED) || (other.blocks_air & ZONE_BLOCKED)))
|
||||||
|
|||||||
@@ -20,14 +20,14 @@
|
|||||||
} \
|
} \
|
||||||
else if (B.z != A.z) { \
|
else if (B.z != A.z) { \
|
||||||
if (B.z < A.z) { \
|
if (B.z < A.z) { \
|
||||||
if (!istype(A, /turf/simulated/open)) { \
|
if (!isopenturf(A)) { \
|
||||||
ret = BLOCKED; \
|
ret = BLOCKED; \
|
||||||
} else { \
|
} else { \
|
||||||
ret = ZONE_BLOCKED; \
|
ret = ZONE_BLOCKED; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
else { \
|
else { \
|
||||||
if (!istype(B, /turf/simulated/open)) { \
|
if (!isopenturf(B)) { \
|
||||||
ret = BLOCKED; \
|
ret = BLOCKED; \
|
||||||
} else { \
|
} else { \
|
||||||
ret = ZONE_BLOCKED; \
|
ret = ZONE_BLOCKED; \
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
#define STOP_VISUAL(visual) visual.isprocessing = FALSE; SSeffects.visuals -= visual;
|
#define STOP_VISUAL(visual) visual.isprocessing = FALSE; SSeffects.visuals -= visual;
|
||||||
|
|
||||||
// -- SSopenturf --
|
// -- SSopenturf --
|
||||||
#define CHECK_OO_EXISTENCE(OO) if (OO && !istype(OO.loc, /turf/simulated/open)) { qdel(OO); }
|
#define CHECK_OO_EXISTENCE(OO) if (OO && !isopenturf(OO.loc)) { qdel(OO); }
|
||||||
#define UPDATE_OO_IF_PRESENT CHECK_OO_EXISTENCE(bound_overlay); if (bound_overlay) { update_above(); }
|
#define UPDATE_OO_IF_PRESENT CHECK_OO_EXISTENCE(bound_overlay); if (bound_overlay) { update_above(); }
|
||||||
|
|
||||||
// -- SSfalling --
|
// -- SSfalling --
|
||||||
|
|||||||
@@ -52,3 +52,5 @@
|
|||||||
#define send_rsc(target, rsc_content, rsc_name) target << browse_rsc(rsc_content, rsc_name)
|
#define send_rsc(target, rsc_content, rsc_name) target << browse_rsc(rsc_content, rsc_name)
|
||||||
|
|
||||||
#define CanInteract(user, state) (CanUseTopic(user, state) == STATUS_INTERACTIVE)
|
#define CanInteract(user, state) (CanUseTopic(user, state) == STATUS_INTERACTIVE)
|
||||||
|
|
||||||
|
#define isopenturf(target) istype(target, /turf/simulated/open)
|
||||||
|
|||||||
@@ -78,10 +78,10 @@
|
|||||||
// Invokes fall_through() after the atom is moved to
|
// Invokes fall_through() after the atom is moved to
|
||||||
// its new destination this cycle. Immediately invokes fall_impact and
|
// its new destination this cycle. Immediately invokes fall_impact and
|
||||||
// fall_collateral if the next turf is not open space.
|
// fall_collateral if the next turf is not open space.
|
||||||
if (istype(victim.loc, /turf/simulated/open))
|
if (isopenturf(victim.loc))
|
||||||
victim.forceMove(below)
|
victim.forceMove(below)
|
||||||
|
|
||||||
if (istype(victim.loc, /turf/simulated/open))
|
if (isopenturf(victim.loc))
|
||||||
victim.fall_through()
|
victim.fall_through()
|
||||||
else
|
else
|
||||||
// This is a lookahead. It removes any lag from being moved onto
|
// This is a lookahead. It removes any lag from being moved onto
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// Seems to be much simpler/saner than /vg/'s implementation.
|
// Seems to be much simpler/saner than /vg/'s implementation.
|
||||||
|
|
||||||
// Turfs that will be colored as HOLOMAP_ROCK
|
// 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
|
// Turfs that will be colored as HOLOMAP_OBSTACLE
|
||||||
#define IS_OBSTACLE(tile) ((!istype(tile, /turf/space) && istype(tile.loc, /area/mine/unexplored)) \
|
#define IS_OBSTACLE(tile) ((!istype(tile, /turf/space) && istype(tile.loc, /area/mine/unexplored)) \
|
||||||
|
|||||||
@@ -195,6 +195,6 @@
|
|||||||
|
|
||||||
/datum/controller/subsystem/openturf/proc/calculate_depth(turf/simulated/open/T)
|
/datum/controller/subsystem/openturf/proc/calculate_depth(turf/simulated/open/T)
|
||||||
. = 0
|
. = 0
|
||||||
while (T && istype(T.below, /turf/simulated/open))
|
while (T && isopenturf(T.below))
|
||||||
T = T.below
|
T = T.below
|
||||||
.++
|
.++
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
/obj/item/weapon/plastique/afterattack(atom/movable/target, mob/user, flag)
|
/obj/item/weapon/plastique/afterattack(atom/movable/target, mob/user, flag)
|
||||||
if (!flag)
|
if (!flag)
|
||||||
return
|
return
|
||||||
if (ismob(target) || istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle)|| istype(target, /turf/simulated/open) || istype(target, /obj/item/weapon/storage/) || istype(target, /obj/item/clothing/accessory/storage/) || istype(target, /obj/item/clothing/under))
|
if (ismob(target) || istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle)|| isopenturf(target) || istype(target, /obj/item/weapon/storage/) || istype(target, /obj/item/clothing/accessory/storage/) || istype(target, /obj/item/clothing/under))
|
||||||
return
|
return
|
||||||
user << "Planting explosives..."
|
user << "Planting explosives..."
|
||||||
user.do_attack_animation(target)
|
user.do_attack_animation(target)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
/obj/structure/lattice/Initialize()
|
/obj/structure/lattice/Initialize()
|
||||||
. = ..()
|
. = ..()
|
||||||
if (restrict_placement)
|
if (restrict_placement)
|
||||||
if(!(istype(loc, /turf/space) || istype(loc, /turf/simulated/open) || istype(loc, /turf/simulated/floor/asteroid)))
|
if(!(istype(loc, /turf/space) || isopenturf(loc) || istype(loc, /turf/simulated/floor/asteroid)))
|
||||||
return INITIALIZE_HINT_QDEL
|
return INITIALIZE_HINT_QDEL
|
||||||
for(var/obj/structure/lattice/LAT in loc)
|
for(var/obj/structure/lattice/LAT in loc)
|
||||||
if(LAT != src)
|
if(LAT != src)
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ var/const/enterloopsanity = 100
|
|||||||
|
|
||||||
if (roof_flags & ROOF_CLEANUP)
|
if (roof_flags & ROOF_CLEANUP)
|
||||||
var/turf/above = GetAbove(src)
|
var/turf/above = GetAbove(src)
|
||||||
if (!above || istype(above, /turf/simulated/open))
|
if (!above || isopenturf(above))
|
||||||
return
|
return
|
||||||
|
|
||||||
above.ChangeTurf(/turf/simulated/open)
|
above.ChangeTurf(/turf/simulated/open)
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ var/global/movement_disabled_exception //This is the client that calls the proc,
|
|||||||
|
|
||||||
for(var/obj/machinery/door/airlock/A in machines)
|
for(var/obj/machinery/door/airlock/A in machines)
|
||||||
var/turf/T = get_turf(A)
|
var/turf/T = get_turf(A)
|
||||||
if(istype(T, /turf/space) || istype(T, /turf/simulated/floor/asteroid) || istype(T, /turf/simulated/open) || T.density)
|
if(istype(T, /turf/space) || istype(T, /turf/simulated/floor/asteroid) || isopenturf(T) || T.density)
|
||||||
usr << "Airlock [A] with bad turf at ([A.x],[A.y],[A.z]) in [T.loc]."
|
usr << "Airlock [A] with bad turf at ([A.x],[A.y],[A.z]) in [T.loc]."
|
||||||
|
|
||||||
/client/proc/get_bad_fdoors()
|
/client/proc/get_bad_fdoors()
|
||||||
|
|||||||
@@ -590,7 +590,7 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/turf/leapEnd = get_step(TA, H.dir)
|
var/turf/leapEnd = get_step(TA, H.dir)
|
||||||
if (!leapEnd || istype(leapEnd, /turf/simulated/open) || istype(leapEnd, /turf/space)\
|
if (!leapEnd || isopenturf(leapEnd) || istype(leapEnd, /turf/space)\
|
||||||
|| leapEnd.density || leapEnd.contains_dense_objects())
|
|| leapEnd.density || leapEnd.contains_dense_objects())
|
||||||
to_chat(H, "<span class='warning'>There is no valid ledge to scale ahead of you!</span>")
|
to_chat(H, "<span class='warning'>There is no valid ledge to scale ahead of you!</span>")
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -342,7 +342,7 @@
|
|||||||
|
|
||||||
turfs += T
|
turfs += T
|
||||||
|
|
||||||
if (istype(T, /turf/simulated/open) && T:below)
|
if (isopenturf(T) && T:below)
|
||||||
T = T:below // Consider the turf below us as well. (Z-lights)
|
T = T:below // Consider the turf below us as well. (Z-lights)
|
||||||
goto check_t
|
goto check_t
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
CHECK_TICK
|
CHECK_TICK
|
||||||
|
|
||||||
if (istype(T, /turf/simulated/open) && T:below)
|
if (isopenturf(T) && T:below)
|
||||||
T = T:below
|
T = T:below
|
||||||
goto check_t
|
goto check_t
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
/obj/item/weapon/ladder_mobile/proc/place_ladder(atom/A, mob/user)
|
/obj/item/weapon/ladder_mobile/proc/place_ladder(atom/A, mob/user)
|
||||||
|
|
||||||
if (istype(A, /turf/simulated/open)) //Place into open space
|
if (isopenturf(A)) //Place into open space
|
||||||
var/turf/below_loc = GetBelow(A)
|
var/turf/below_loc = GetBelow(A)
|
||||||
if (!below_loc || (istype(/turf/space, below_loc)))
|
if (!below_loc || (istype(/turf/space, below_loc)))
|
||||||
to_chat(user, "<span class='notice'>Why would you do that?! There is only infinite space there...</span>")
|
to_chat(user, "<span class='notice'>Why would you do that?! There is only infinite space there...</span>")
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
else if (istype(A, /turf/simulated/floor)) //Place onto Floor
|
else if (istype(A, /turf/simulated/floor)) //Place onto Floor
|
||||||
var/turf/upper_loc = GetAbove(A)
|
var/turf/upper_loc = GetAbove(A)
|
||||||
if (!upper_loc || !istype(upper_loc,/turf/simulated/open))
|
if (!upper_loc || !isopenturf(upper_loc))
|
||||||
user << "<span class='notice'>There is something above. You can't deploy!</span>"
|
user << "<span class='notice'>There is something above. You can't deploy!</span>"
|
||||||
return
|
return
|
||||||
user.visible_message("<span class='warning'>[user] begins deploying \the [src] on \the [A].</span>",
|
user.visible_message("<span class='warning'>[user] begins deploying \the [src] on \the [A].</span>",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
/turf/Entered(atom/movable/thing, atom/oldLoc)
|
/turf/Entered(atom/movable/thing, atom/oldLoc)
|
||||||
. = ..()
|
. = ..()
|
||||||
if (above && !thing.no_z_overlay && !thing.bound_overlay && !istype(oldLoc, /turf/simulated/open))
|
if (above && !thing.no_z_overlay && !thing.bound_overlay && !isopenturf(oldLoc))
|
||||||
above.update_icon()
|
above.update_icon()
|
||||||
|
|
||||||
/turf/Destroy()
|
/turf/Destroy()
|
||||||
@@ -43,8 +43,11 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
// check_existence returns TRUE if the overlay is valid.
|
// check_existence returns TRUE if the overlay is valid.
|
||||||
if (bound_overlay.check_existence() && !bound_overlay.queued)
|
if (isopenturf(bound_overlay.loc) && !bound_overlay.queued)
|
||||||
SSopenturf.queued_overlays += bound_overlay
|
SSopenturf.queued_overlays += bound_overlay
|
||||||
|
bound_overlay.queued = TRUE
|
||||||
|
else
|
||||||
|
qdel(bound_overlay)
|
||||||
|
|
||||||
/atom/movable/proc/get_above_oo()
|
/atom/movable/proc/get_above_oo()
|
||||||
. = list()
|
. = list()
|
||||||
@@ -136,22 +139,13 @@
|
|||||||
|
|
||||||
/atom/movable/openspace/overlay/forceMove(atom/dest)
|
/atom/movable/openspace/overlay/forceMove(atom/dest)
|
||||||
. = ..()
|
. = ..()
|
||||||
if (istype(dest, /turf/simulated/open))
|
if (isopenturf(dest))
|
||||||
if (destruction_timer)
|
if (destruction_timer)
|
||||||
deltimer(destruction_timer)
|
deltimer(destruction_timer)
|
||||||
destruction_timer = null
|
destruction_timer = null
|
||||||
else if (!destruction_timer)
|
else if (!destruction_timer)
|
||||||
destruction_timer = addtimer(CALLBACK(GLOBAL_PROC, /proc/qdel, src), 10 SECONDS, TIMER_STOPPABLE)
|
destruction_timer = addtimer(CALLBACK(GLOBAL_PROC, /proc/qdel, src), 10 SECONDS, TIMER_STOPPABLE)
|
||||||
|
|
||||||
// Checks if we've moved off of an openturf.
|
|
||||||
// Returns TRUE if we're continuing to exist, FALSE if we're deleting ourselves.
|
|
||||||
/atom/movable/openspace/overlay/proc/check_existence()
|
|
||||||
if (!istype(loc, /turf/simulated/open))
|
|
||||||
qdel(src)
|
|
||||||
return FALSE
|
|
||||||
else
|
|
||||||
return TRUE
|
|
||||||
|
|
||||||
// Called when the turf we're on is deleted/changed.
|
// Called when the turf we're on is deleted/changed.
|
||||||
/atom/movable/openspace/overlay/proc/owning_turf_changed()
|
/atom/movable/openspace/overlay/proc/owning_turf_changed()
|
||||||
if (!destruction_timer)
|
if (!destruction_timer)
|
||||||
|
|||||||
@@ -666,7 +666,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
|||||||
return
|
return
|
||||||
///// Z-Level Stuff
|
///// Z-Level Stuff
|
||||||
// check if the target is open space
|
// check if the target is open space
|
||||||
if(istype(F, /turf/simulated/open))
|
if(isopenturf(F))
|
||||||
for(var/obj/structure/cable/LC in F)
|
for(var/obj/structure/cable/LC in F)
|
||||||
if((LC.d1 == dirn && LC.d2 == 11 ) || ( LC.d2 == dirn && LC.d1 == 11))
|
if((LC.d1 == dirn && LC.d2 == 11 ) || ( LC.d2 == dirn && LC.d1 == 11))
|
||||||
user << "<span class='warning'>There's already a cable at that position.</span>"
|
user << "<span class='warning'>There's already a cable at that position.</span>"
|
||||||
|
|||||||
@@ -164,10 +164,10 @@ datum/unit_test/wire_test/start_test()
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
var/bad = 0
|
var/bad = 0
|
||||||
if (ladder.target_up && !istype(GetAbove(ladder), /turf/simulated/open))
|
if (ladder.target_up && !isopenturf(GetAbove(ladder)))
|
||||||
bad |= BLOCKED_UP
|
bad |= BLOCKED_UP
|
||||||
|
|
||||||
if (ladder.target_down && !istype(ladder.loc, /turf/simulated/open))
|
if (ladder.target_down && !isopenturf(ladder.loc))
|
||||||
bad |= BLOCKED_DOWN
|
bad |= BLOCKED_DOWN
|
||||||
|
|
||||||
if (bad)
|
if (bad)
|
||||||
|
|||||||
Reference in New Issue
Block a user