Replace explicit z-level checks with defines

This commit is contained in:
Tad Hardesty
2017-12-29 11:40:06 -08:00
committed by CitadelStationBot
parent 48e0c47410
commit 0418ee4df6
96 changed files with 268 additions and 145 deletions
+2 -2
View File
@@ -430,14 +430,14 @@ Code:
switch(SSshuttle.supply.mode)
if(SHUTTLE_CALL)
menu += "Moving to "
if(!(SSshuttle.supply.z in GLOB.station_z_levels))
if(!is_station_level(SSshuttle.supply.z))
menu += "station"
else
menu += "centcom"
menu += " ([SSshuttle.supply.timeLeft(600)] Mins)"
else
menu += "At "
if(!(SSshuttle.supply.z in GLOB.station_z_levels))
if(!is_station_level(SSshuttle.supply.z))
menu += "centcom"
else
menu += "station"
+1 -1
View File
@@ -72,7 +72,7 @@
/obj/item/storage/backpack/holding/handle_item_insertion(obj/item/W, prevent_warning = 0, mob/living/user)
if((istype(W, /obj/item/storage/backpack/holding) || count_by_type(W.GetAllContents(), /obj/item/storage/backpack/holding)))
var/turf/loccheck = get_turf(src)
if(loccheck.z == ZLEVEL_CITYOFCOGS)
if(is_reebe(loccheck.z))
user.visible_message("<span class='warning'>An unseen force knocks [user] to the ground!</span>", "<span class='big_brass'>\"I think not!\"</span>")
user.Knockdown(60)
return
+3 -3
View File
@@ -52,7 +52,7 @@ Frequency:
if (usr.stat || usr.restrained())
return
var/turf/current_location = get_turf(usr)//What turf is the user on?
if(!current_location || current_location.z == ZLEVEL_CENTCOM)//If turf was not found or they're on CentCom
if(!current_location || is_centcom_level(current_location.z))//If turf was not found or they're on CentCom
to_chat(usr, "[src] is malfunctioning.")
return
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)))
@@ -167,7 +167,7 @@ Frequency:
/obj/item/hand_tele/attack_self(mob/user)
var/turf/current_location = get_turf(user)//What turf is the user on?
var/area/current_area = current_location.loc
if(!current_location || current_area.noteleport || current_location.z > ZLEVEL_SPACEMAX || !isturf(user.loc))//If turf was not found or they're on z level 2 or >7 which does not currently exist. or if user is not located on a turf
if(!current_location || current_area.noteleport || is_away_level(current_location.z) || !isturf(user.loc))//If turf was not found or they're on z level 2 or >7 which does not currently exist. or if user is not located on a turf
to_chat(user, "<span class='notice'>\The [src] is malfunctioning.</span>")
return
var/list/L = list( )
@@ -205,7 +205,7 @@ Frequency:
return
current_location = get_turf(user) //Recheck.
current_area = current_location.loc
if(!current_location || current_area.noteleport || current_location.z > ZLEVEL_SPACEMAX || !isturf(user.loc))//If turf was not found or they're on z level 2 or >7 which does not currently exist. or if user is not located on a turf
if(!current_location || current_area.noteleport || is_away_level(current_location.z) || !isturf(user.loc))//If turf was not found or they're on z level 2 or >7 which does not currently exist. or if user is not located on a turf
to_chat(user, "<span class='notice'>\The [src] is malfunctioning.</span>")
return
user.show_message("<span class='notice'>Locked In.</span>", 2)
+2 -2
View File
@@ -63,7 +63,7 @@
canSmoothWith += /turf/open/indestructible/clock_spawn_room //list overrides are a terrible thing
. = ..()
ratvar_act()
if(z == ZLEVEL_CITYOFCOGS)
if(is_reebe(z))
resistance_flags |= INDESTRUCTIBLE
/obj/structure/lattice/clockwork/ratvar_act()
@@ -120,7 +120,7 @@
if(!mapload)
new /obj/effect/temp_visual/ratvar/floor/catwalk(loc)
new /obj/effect/temp_visual/ratvar/beam/catwalk(loc)
if(z == ZLEVEL_CITYOFCOGS)
if(is_reebe(z))
resistance_flags |= INDESTRUCTIBLE
/obj/structure/lattice/catwalk/clockwork/ratvar_act()