Removes most hard-coded z level checks

This commit is contained in:
Crazylemon64
2016-07-31 21:29:03 -07:00
parent f54de64a73
commit bf2bcbce67
122 changed files with 325 additions and 410 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
switch(name) //some of these are probably obsolete
if("shuttle")
shuttle_z = z
log_debug("Obsolete landmark '[name]' at ([x],[y],[z])")
qdel(src)
if("airtunnel_stop")
@@ -61,7 +61,6 @@
return null
var/turf/T = get_turf(user.loc)
// TODO: Tie into space manager
if(T.z != current.z || !current.can_use())
to_chat(user, "<span class='danger'>[src] has lost the signal.</span>")
current = null
@@ -226,7 +225,6 @@
to_chat(usr, "<span class='danger'>Something's wrong with that camera. You can't get a feed.</span>")
return
var/turf/T = get_turf(loc)
// TODO: Tie into space manager
if(!T || C.z != T.z)
to_chat(usr, "<span class='danger'>You can't get a signal.</span>")
return
@@ -124,7 +124,7 @@
return -1
if(!(0 in level))
var/turf/position = get_turf(src)
// TODO: Tie into space manager
// TODO: Integrate radio with the space manager
if(isnull(position) || !(position.z in level))
return -1
if(!src.listening)
@@ -64,8 +64,7 @@
//Play sound through the station intercomms, so everyone knows the doom you have wrought.
for(var/O in global_intercoms)
var/obj/item/device/radio/intercom/I = O
// TODO: Tie into space manager
if(I.z != ZLEVEL_STATION) //Only broadcast to the station intercoms
if(!is_station_level(I.z)) //Only broadcast to the station intercoms
continue
if(!I.on) //Only broadcast to active intercoms (powered, switched on)
continue
@@ -48,8 +48,7 @@ Frequency:
return 1
var/turf/current_location = get_turf(usr)//What turf is the user on?
// TODO: Tie into space manager
if(!current_location ||( current_location.z in config.admin_levels))//If turf was not found or they're on z level 2.
if(!current_location || is_admin_level(current_location.z))//If turf was not found or they're in the admin zone
to_chat(usr, "<span class='warning'>\The [src] is malfunctioning.</span>")
return 1
@@ -62,7 +61,6 @@ Frequency:
for(var/obj/item/device/radio/beacon/W in beacons)
if(W.frequency == frequency && !W.syndicate)
// TODO: Tie into space manager
if(W && W.z == z)
var/turf/TB = get_turf(W)
temp += "[W.code]: [TB.x], [TB.y], [TB.z]<BR>"
@@ -109,8 +107,7 @@ Frequency:
/obj/item/weapon/hand_tele/attack_self(mob/user as mob)
var/turf/current_location = get_turf(user)//What turf is the user on?
// TODO: Tie into space manager
if(!current_location||(current_location.z in config.admin_levels)||current_location.z>=ZLEVEL_EMPTY)//If turf was not found or they're on z level 2 or >7 which does not currently exist.
if(!current_location||!is_teleport_allowed(current_location.z))//If turf was not found or they're somewhere teleproof
to_chat(user, "<span class='notice'>\The [src] is malfunctioning.</span>")
return
var/list/L = list( )
@@ -192,8 +192,7 @@
return
var/obj/item/weapon/rcs/E = W
if(E.rcell && (E.rcell.charge >= E.chargecost))
// TODO: Tie into space manager
if(!(src.z in config.contact_levels))
if(!is_station_contact(src.z))
to_chat(user, "<span class='warning'>The rapid-crate-sender can't locate any telepads!</span>")
return
if(E.mode == 0)
@@ -84,8 +84,7 @@
if(istype(W, /obj/item/weapon/rcs) && !src.opened)
var/obj/item/weapon/rcs/E = W
if(E.rcell && (E.rcell.charge >= E.chargecost))
// TODO: Tie into space manager
if(!(src.z in config.player_levels))
if(!is_level_reachable(src.z)) // This is inconsistent with the closet sending code
to_chat(user, "<span class='warning'>The rapid-crate-sender can't locate any telepads!</span>")
return
if(E.mode == 0)