Replaces yet more istypes with helpers (#20806)

* uses more istype helpers

* oranges is inefficient
This commit is contained in:
Joan Lung
2016-10-10 00:48:35 -04:00
committed by oranges
parent add37bea48
commit ce13143d9d
58 changed files with 104 additions and 109 deletions

View File

@@ -441,7 +441,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
// For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf. // For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
/proc/get_atom_on_turf(atom/movable/M) /proc/get_atom_on_turf(atom/movable/M)
var/atom/loc = M var/atom/loc = M
while(loc && loc.loc && !istype(loc.loc, /turf/)) while(loc && loc.loc && !isturf(loc.loc))
loc = loc.loc loc = loc.loc
return loc return loc

View File

@@ -382,7 +382,7 @@ var/datum/subsystem/job/SSjob
if(clear) if(clear)
S = T S = T
continue continue
if(istype(S, /obj/effect/landmark) && istype(S.loc, /turf)) if(istype(S, /obj/effect/landmark) && isturf(S.loc))
H.loc = S.loc H.loc = S.loc
if(H.mind) if(H.mind)

View File

@@ -415,7 +415,7 @@ var/list/blood_splatter_icons = list()
return return
/atom/proc/add_vomit_floor(mob/living/carbon/M, toxvomit = 0) /atom/proc/add_vomit_floor(mob/living/carbon/M, toxvomit = 0)
if(istype(src,/turf) ) if(isturf(src))
var/obj/effect/decal/cleanable/vomit/V = PoolOrNew(/obj/effect/decal/cleanable/vomit, src) var/obj/effect/decal/cleanable/vomit/V = PoolOrNew(/obj/effect/decal/cleanable/vomit, src)
// Make toxins vomit look different // Make toxins vomit look different
if(toxvomit) if(toxvomit)
@@ -441,4 +441,4 @@ var/list/blood_splatter_icons = list()
admin_spawned = TRUE admin_spawned = TRUE
/atom/proc/mech_melee_attack(obj/mecha/M) /atom/proc/mech_melee_attack(obj/mecha/M)
return return

View File

@@ -248,7 +248,7 @@
while(target && ((dist_travelled < range && loc != finalturf) || !has_gravity(src))) //stop if we reached our destination (or max range) and aren't floating while(target && ((dist_travelled < range && loc != finalturf) || !has_gravity(src))) //stop if we reached our destination (or max range) and aren't floating
var/slept = 0 var/slept = 0
if(!istype(loc, /turf)) if(!isturf(loc))
hit = 1 hit = 1
break break

View File

@@ -50,7 +50,7 @@
if(!ishuman(H)) if(!ishuman(H))
return 1 return 1
if(loc == H || (in_range(src, H) && istype(loc, /turf))) if(loc == H || (in_range(src, H) && isturf(loc)))
H.set_machine(src) H.set_machine(src)
if(href_list["school"]) if(href_list["school"])
if (used) if (used)

View File

@@ -162,7 +162,7 @@
var/time = round(determine_domination_time(tempgang)/60,0.1) var/time = round(determine_domination_time(tempgang)/60,0.1)
if(alert(user,"With [round((tempgang.territory.len/start_state.num_territories)*100, 1)]% station control, a takeover will require [time] minutes.\nYour gang will be unable to gain influence while it is active.\nThe entire station will likely be alerted to it once it starts.\nYou have [tempgang.dom_attempts] attempt(s) remaining. Are you ready?","Confirm","Ready","Later") == "Ready") if(alert(user,"With [round((tempgang.territory.len/start_state.num_territories)*100, 1)]% station control, a takeover will require [time] minutes.\nYour gang will be unable to gain influence while it is active.\nThe entire station will likely be alerted to it once it starts.\nYou have [tempgang.dom_attempts] attempt(s) remaining. Are you ready?","Confirm","Ready","Later") == "Ready")
if((tempgang.is_dominating) || !tempgang.dom_attempts || !in_range(src, user) || !istype(src.loc, /turf)) if((tempgang.is_dominating) || !tempgang.dom_attempts || !in_range(src, user) || !isturf(loc))
return 0 return 0
var/area/A = get_area(loc) var/area/A = get_area(loc)

View File

@@ -665,7 +665,7 @@
return return
var/datum/spellbook_entry/E = null var/datum/spellbook_entry/E = null
if(loc == H || (in_range(src, H) && istype(loc, /turf))) if(loc == H || (in_range(src, H) && isturf(loc)))
H.set_machine(src) H.set_machine(src)
if(href_list["buy"]) if(href_list["buy"])
E = entries[text2num(href_list["buy"])] E = entries[text2num(href_list["buy"])]

View File

@@ -642,7 +642,7 @@ var/list/airlock_overlays = list()
usr.unset_machine() usr.unset_machine()
return return
if((in_range(src, usr) && istype(src.loc, /turf)) && panel_open) if((in_range(src, usr) && isturf(loc)) && panel_open)
usr.set_machine(src) usr.set_machine(src)

View File

@@ -1007,7 +1007,7 @@ var/list/obj/machinery/newscaster/allCasters = list()
/obj/item/weapon/newspaper/Topic(href, href_list) /obj/item/weapon/newspaper/Topic(href, href_list)
var/mob/living/U = usr var/mob/living/U = usr
..() ..()
if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) )) if((src in U.contents) || (isturf(loc) && in_range(src, U)))
U.set_machine(src) U.set_machine(src)
if(href_list["next_page"]) if(href_list["next_page"])
if(curr_page == pages+1) if(curr_page == pages+1)

View File

@@ -210,7 +210,7 @@
if(istype(target, /turf/open/space/transit))//>implying these are ever made -Sieve if(istype(target, /turf/open/space/transit))//>implying these are ever made -Sieve
return return
if(!istype(target, /turf) && !istype(target, /obj/machinery/door/airlock)) if(!isturf(target) && !istype(target, /obj/machinery/door/airlock))
target = get_turf(target) target = get_turf(target)
if(!action_checks(target) || get_dist(chassis, target)>3) if(!action_checks(target) || get_dist(chassis, target)>3)
return return

View File

@@ -144,7 +144,7 @@
return ..() return ..()
/datum/effect_system/foam_spread/set_up(amt=5, loca, datum/reagents/carry = null) /datum/effect_system/foam_spread/set_up(amt=5, loca, datum/reagents/carry = null)
if(istype(loca, /turf/)) if(isturf(loca))
location = loca location = loca
else else
location = get_turf(loca) location = get_turf(loca)

View File

@@ -266,7 +266,7 @@
return ..() return ..()
/datum/effect_system/smoke_spread/chem/set_up(datum/reagents/carry = null, radius = 1, loca, silent = 0) /datum/effect_system/smoke_spread/chem/set_up(datum/reagents/carry = null, radius = 1, loca, silent = 0)
if(istype(loca, /turf/)) if(isturf(loca))
location = loca location = loca
else else
location = get_turf(loca) location = get_turf(loca)

View File

@@ -15,20 +15,20 @@
..() ..()
flick("sparks", src) // replay the animation flick("sparks", src) // replay the animation
playsound(src.loc, "sparks", 100, 1) playsound(src.loc, "sparks", 100, 1)
var/turf/T = src.loc var/turf/T = loc
if (istype(T, /turf)) if(isturf(T))
T.hotspot_expose(1000,100) T.hotspot_expose(1000,100)
QDEL_IN(src, 20) QDEL_IN(src, 20)
/obj/effect/particle_effect/sparks/Destroy() /obj/effect/particle_effect/sparks/Destroy()
var/turf/T = src.loc var/turf/T = loc
if (istype(T, /turf)) if(isturf(T))
T.hotspot_expose(1000,100) T.hotspot_expose(1000,100)
return ..() return ..()
/obj/effect/particle_effect/sparks/Move() /obj/effect/particle_effect/sparks/Move()
..() ..()
var/turf/T = src.loc var/turf/T = loc
if(isturf(T)) if(isturf(T))
T.hotspot_expose(1000,100) T.hotspot_expose(1000,100)

View File

@@ -103,7 +103,7 @@
/obj/structure/spider/spiderling/process() /obj/structure/spider/spiderling/process()
if(travelling_in_vent) if(travelling_in_vent)
if(istype(src.loc, /turf)) if(isturf(loc))
travelling_in_vent = 0 travelling_in_vent = 0
entry_vent = null entry_vent = null
else if(entry_vent) else if(entry_vent)

View File

@@ -1,7 +1,7 @@
/proc/empulse(turf/epicenter, heavy_range, light_range, log=0) /proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
if(!epicenter) return if(!epicenter) return
if(!istype(epicenter, /turf)) if(!isturf(epicenter))
epicenter = get_turf(epicenter.loc) epicenter = get_turf(epicenter.loc)
if(log) if(log)

View File

@@ -99,7 +99,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s
/obj/item/proc/check_allowed_items(atom/target, not_inside, target_self) /obj/item/proc/check_allowed_items(atom/target, not_inside, target_self)
if(((src in target) && !target_self) || (!istype(target.loc, /turf) && !istype(target, /turf) && not_inside)) if(((src in target) && !target_self) || (!isturf(target.loc) && !isturf(target) && not_inside))
return 0 return 0
else else
return 1 return 1
@@ -139,7 +139,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s
set category = "Object" set category = "Object"
set src in oview(1) set src in oview(1)
if(!istype(src.loc, /turf) || usr.stat || usr.restrained() || !usr.canmove) if(!isturf(loc) || usr.stat || usr.restrained() || !usr.canmove)
return return
var/turf/T = src.loc var/turf/T = src.loc
@@ -596,4 +596,4 @@ obj/item/proc/item_action_slot_check(slot, mob/user)
MO.pixel_x = rand(-16,16) MO.pixel_x = rand(-16,16)
MO.pixel_y = rand(-16,16) MO.pixel_y = rand(-16,16)
MO.desc = "Looks like this was \an [src] some time ago." MO.desc = "Looks like this was \an [src] some time ago."
..() ..()

View File

@@ -762,7 +762,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
user << "<span class='notice'>Card scanned.</span>" user << "<span class='notice'>Card scanned.</span>"
else else
//Basic safety check. If either both objects are held by user or PDA is on ground and card is in hand. //Basic safety check. If either both objects are held by user or PDA is on ground and card is in hand.
if(((src in user.contents) && (C in user.contents)) || (istype(loc, /turf) && in_range(src, user) && (C in user.contents)) ) if(((src in user.contents) || (isturf(loc) && in_range(src, user))) && (C in user.contents))
if(!id_check(user, 2)) if(!id_check(user, 2))
return return
user << "<span class='notice'>You put the ID into \the [src]'s slot.</span>" user << "<span class='notice'>You put the ID into \the [src]'s slot.</span>"

View File

@@ -154,7 +154,7 @@
else if(istype(W, /obj/item/device/mmi)) else if(istype(W, /obj/item/device/mmi))
var/obj/item/device/mmi/M = W var/obj/item/device/mmi/M = W
if(check_completion()) if(check_completion())
if(!istype(loc,/turf)) if(!isturf(loc))
user << "<span class='warning'>You can't put the MMI in, the frame has to be standing on the ground to be perfectly precise!</span>" user << "<span class='warning'>You can't put the MMI in, the frame has to be standing on the ground to be perfectly precise!</span>"
return return
if(!M.brainmob) if(!M.brainmob)

View File

@@ -62,7 +62,7 @@
/obj/item/stack/sheet/glass/proc/construct_window(mob/user) /obj/item/stack/sheet/glass/proc/construct_window(mob/user)
if(!user || !src) if(!user || !src)
return 0 return 0
if(!istype(user.loc,/turf)) if(!isturf(user.loc))
return 0 return 0
if(!user.IsAdvancedToolUser()) if(!user.IsAdvancedToolUser())
user << "<span class='warning'>You don't have the dexterity to do this!</span>" user << "<span class='warning'>You don't have the dexterity to do this!</span>"
@@ -168,7 +168,7 @@
/obj/item/stack/sheet/rglass/proc/construct_window(mob/user) /obj/item/stack/sheet/rglass/proc/construct_window(mob/user)
if(!user || !src) if(!user || !src)
return 0 return 0
if(!istype(user.loc,/turf)) if(!isturf(user.loc))
return 0 return 0
if(!user.IsAdvancedToolUser()) if(!user.IsAdvancedToolUser())
user << "<span class='warning'>You don't have the dexterity to do this!</span>" user << "<span class='warning'>You don't have the dexterity to do this!</span>"

View File

@@ -304,7 +304,7 @@ RCD
if(!proximity) return 0 if(!proximity) return 0
if(istype(A,/area/shuttle)||istype(A,/turf/open/space/transit)) if(istype(A,/area/shuttle)||istype(A,/turf/open/space/transit))
return 0 return 0
if(!(istype(A, /turf) || istype(A, /obj/machinery/door/airlock) || istype(A, /obj/structure/grille) || istype(A, /obj/structure/window))) if(!(isturf(A) || istype(A, /obj/machinery/door/airlock) || istype(A, /obj/structure/grille) || istype(A, /obj/structure/window)))
return 0 return 0
switch(mode) switch(mode)

View File

@@ -564,7 +564,7 @@ var/global/list/RPD_recipes=list(
user << "<span class='warning'>The [src]'s error light flickers! Perhaps you need to only use it on pipes and pipe meters?</span>" user << "<span class='warning'>The [src]'s error light flickers! Perhaps you need to only use it on pipes and pipe meters?</span>"
return 0 return 0
if(ATMOS_MODE) if(ATMOS_MODE)
if(!(istype(A, /turf))) if(!isturf(A))
user << "<span class='warning'>The [src]'s error light flickers!</span>" user << "<span class='warning'>The [src]'s error light flickers!</span>"
return 0 return 0
user << "<span class='notice'>You start building pipes...</span>" user << "<span class='notice'>You start building pipes...</span>"
@@ -579,7 +579,7 @@ var/global/list/RPD_recipes=list(
return 0 return 0
if(METER_MODE) if(METER_MODE)
if(!(istype(A, /turf))) if(!isturf(A))
user << "<span class='warning'>The [src]'s error light flickers!</span>" user << "<span class='warning'>The [src]'s error light flickers!</span>"
return 0 return 0
user << "<span class='notice'>You start building meter...</span>" user << "<span class='notice'>You start building meter...</span>"

View File

@@ -62,7 +62,7 @@
..() ..()
if(usr.stat) if(usr.stat)
return return
if((usr.contents.Find(src)) || ((in_range(src, usr) && istype(loc, /turf)))) if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)))
usr.set_machine(src) usr.set_machine(src)
if(istype(loc, /mob)) if(istype(loc, /mob))

View File

@@ -37,7 +37,7 @@
if (!ishuman(usr)) if (!ishuman(usr))
return 1 return 1
var/mob/living/carbon/human/H = usr var/mob/living/carbon/human/H = usr
if ((H == src.loc || (in_range(src, H) && istype(src.loc, /turf)))) if(H == src.loc || (in_range(src, H) && isturf(loc)))
H.set_machine(src) H.set_machine(src)
if (href_list["spell_teleport"]) if (href_list["spell_teleport"])
if (src.uses >= 1) if (src.uses >= 1)
@@ -57,7 +57,7 @@
if (!user || user.stat || user.restrained() || uses <= 0) if (!user || user.stat || user.restrained() || uses <= 0)
return return
if(!((user == loc || (in_range(src, user) && istype(src.loc, /turf))))) if(!(user == loc || (in_range(src, user) && isturf(loc))))
return return
var/datum/effect_system/smoke_spread/smoke = new var/datum/effect_system/smoke_spread/smoke = new

View File

@@ -295,7 +295,7 @@
nanofrost_cooldown = 0 nanofrost_cooldown = 0
return return
if(nozzle_mode == METAL_FOAM) if(nozzle_mode == METAL_FOAM)
if(!Adj|| !istype(target, /turf)) if(!Adj|| !isturf(target))
return return
if(metal_synthesis_cooldown < 5) if(metal_synthesis_cooldown < 5)
var/obj/effect/particle_effect/foam/metal/F = PoolOrNew(/obj/effect/particle_effect/foam/metal, get_turf(target)) var/obj/effect/particle_effect/foam/metal/F = PoolOrNew(/obj/effect/particle_effect/foam/metal, get_turf(target))

View File

@@ -51,7 +51,7 @@ Frequency:
if(!current_location||current_location.z==2)//If turf was not found or they're on z level 2. if(!current_location||current_location.z==2)//If turf was not found or they're on z level 2.
usr << "The [src] is malfunctioning." usr << "The [src] is malfunctioning."
return return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)))) if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)))
usr.set_machine(src) usr.set_machine(src)
if (href_list["refresh"]) if (href_list["refresh"])
src.temp = "<B>Persistent Signal Locator</B><HR>" src.temp = "<B>Persistent Signal Locator</B><HR>"
@@ -141,7 +141,7 @@ Frequency:
/obj/item/weapon/hand_tele/attack_self(mob/user) /obj/item/weapon/hand_tele/attack_self(mob/user)
var/turf/current_location = get_turf(user)//What turf is the user on? var/turf/current_location = get_turf(user)//What turf is the user on?
var/area/current_area = current_location.loc var/area/current_area = current_location.loc
if(!current_location||current_area.noteleport||current_location.z>=7 || !istype(user.loc, /turf))//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 || 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
user << "<span class='notice'>\The [src] is malfunctioning.</span>" user << "<span class='notice'>\The [src] is malfunctioning.</span>"
return return
var/list/L = list( ) var/list/L = list( )

View File

@@ -1,7 +1,7 @@
/proc/radiation_pulse(turf/epicenter, heavy_range, light_range, severity, log=0) /proc/radiation_pulse(turf/epicenter, heavy_range, light_range, severity, log=0)
if(!epicenter || !severity) return if(!epicenter || !severity) return
if(!istype(epicenter, /turf)) if(!isturf(epicenter))
epicenter = get_turf(epicenter.loc) epicenter = get_turf(epicenter.loc)
if(heavy_range > light_range) if(heavy_range > light_range)

View File

@@ -82,7 +82,7 @@
if(!shock(user, 100)) if(!shock(user, 100))
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1) playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
deconstruct() deconstruct()
else if((istype(W, /obj/item/weapon/screwdriver)) && (istype(loc, /turf) || anchored)) else if((istype(W, /obj/item/weapon/screwdriver)) && (isturf(loc) || anchored))
if(!shock(user, 90)) if(!shock(user, 90))
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1) playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
anchored = !anchored anchored = !anchored

View File

@@ -136,7 +136,7 @@
return return
//get the user's location //get the user's location
if( !istype(user.loc, /turf) ) if(!isturf(user.loc))
return //can't do this stuff whilst inside objects and such return //can't do this stuff whilst inside objects and such
add_fingerprint(user) add_fingerprint(user)

View File

@@ -356,11 +356,11 @@
for(var/obj/item/weapon/disk/nuclear/N in poi_list) for(var/obj/item/weapon/disk/nuclear/N in poi_list)
dat += "<tr><td>[N.name], " dat += "<tr><td>[N.name], "
var/atom/disk_loc = N.loc var/atom/disk_loc = N.loc
while(!istype(disk_loc, /turf)) while(!isturf(disk_loc))
if(istype(disk_loc, /mob)) if(ismob(disk_loc))
var/mob/M = disk_loc var/mob/M = disk_loc
dat += "carried by <a href='?_src_=holder;adminplayeropts=\ref[M]'>[M.real_name]</a> " dat += "carried by <a href='?_src_=holder;adminplayeropts=\ref[M]'>[M.real_name]</a> "
if(istype(disk_loc, /obj)) if(isobj(disk_loc))
var/obj/O = disk_loc var/obj/O = disk_loc
dat += "in \a [O.name] " dat += "in \a [O.name] "
disk_loc = disk_loc.loc disk_loc = disk_loc.loc

View File

@@ -134,7 +134,7 @@
vals += v vals += v
vals[v] = SDQL_expression(d, set_list[v]) vals[v] = SDQL_expression(d, set_list[v])
if(istype(d, /turf)) if(isturf(d))
for(var/v in vals) for(var/v in vals)
if(v == "x" || v == "y" || v == "z") if(v == "x" || v == "y" || v == "z")
continue continue

View File

@@ -242,7 +242,7 @@
. = 1 . = 1
switch(mode) switch(mode)
if(BASIC_BUILDMODE) if(BASIC_BUILDMODE)
if(istype(object,/turf) && left_click && !alt_click && !ctrl_click) if(isturf(object) && left_click && !alt_click && !ctrl_click)
var/turf/T = object var/turf/T = object
if(isspaceturf(object)) if(isspaceturf(object))
T.ChangeTurf(/turf/open/floor/plasteel) T.ChangeTurf(/turf/open/floor/plasteel)
@@ -266,10 +266,10 @@
else if(isobj(object)) else if(isobj(object))
qdel(object) qdel(object)
return return
else if(istype(object,/turf) && alt_click && left_click) else if(isturf(object) && alt_click && left_click)
log_admin("Build Mode: [key_name(user)] built an airlock at ([object.x],[object.y],[object.z])") log_admin("Build Mode: [key_name(user)] built an airlock at ([object.x],[object.y],[object.z])")
new/obj/machinery/door/airlock(get_turf(object)) new/obj/machinery/door/airlock(get_turf(object))
else if(istype(object,/turf) && ctrl_click && left_click) else if(isturf(object) && ctrl_click && left_click)
switch(build_dir) switch(build_dir)
if(NORTH) if(NORTH)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object)) var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))

View File

@@ -220,7 +220,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return return
var/turf/T = mob.loc var/turf/T = mob.loc
if (!( istype(T, /turf) )) if(!isturf(T))
return return
var/datum/gas_mixture/env = T.return_air() var/datum/gas_mixture/env = T.return_air()

View File

@@ -141,7 +141,7 @@
if("restore to default") if("restore to default")
O.vars[variable] = initial(O.vars[variable]) O.vars[variable] = initial(O.vars[variable])
if(method) if(method)
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if ( istype(M , O.type) ) if ( istype(M , O.type) )
M.vars[variable] = O.vars[variable] M.vars[variable] = O.vars[variable]
@@ -212,7 +212,7 @@
//Convert the string vars for anything that's not O //Convert the string vars for anything that's not O
if(method) if(method)
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if ( istype(M , O.type) ) if ( istype(M , O.type) )
new_value = pre_processing //reset new_value, ready to convert it uniquely for the next iteration new_value = pre_processing //reset new_value, ready to convert it uniquely for the next iteration
@@ -242,7 +242,7 @@
A.vars[variable] = new_value A.vars[variable] = new_value
CHECK_TICK CHECK_TICK
else if(istype(O, /turf)) else if(isturf(O))
for(var/turf/A in world) for(var/turf/A in world)
if ( istype(A , O.type) ) if ( istype(A , O.type) )
new_value = pre_processing new_value = pre_processing
@@ -257,7 +257,7 @@
A.vars[variable] = new_value A.vars[variable] = new_value
CHECK_TICK CHECK_TICK
else else
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if (M.type == O.type) if (M.type == O.type)
new_value = pre_processing new_value = pre_processing
@@ -287,7 +287,7 @@
A.vars[variable] = new_value A.vars[variable] = new_value
CHECK_TICK CHECK_TICK
else if(istype(O, /turf)) else if(isturf(O))
for(var/turf/A in world) for(var/turf/A in world)
if (A.type == O.type) if (A.type == O.type)
new_value = pre_processing new_value = pre_processing
@@ -313,7 +313,7 @@
O.vars[variable] = new_value O.vars[variable] = new_value
if(method) if(method)
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if ( istype(M , O.type) ) if ( istype(M , O.type) )
if(variable=="luminosity") if(variable=="luminosity")
@@ -331,7 +331,7 @@
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else if(istype(O, /turf)) else if(isturf(O))
for(var/turf/A in world) for(var/turf/A in world)
if ( istype(A , O.type) ) if ( istype(A , O.type) )
if(variable=="luminosity") if(variable=="luminosity")
@@ -341,7 +341,7 @@
CHECK_TICK CHECK_TICK
else else
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if (M.type == O.type) if (M.type == O.type)
if(variable=="luminosity") if(variable=="luminosity")
@@ -359,7 +359,7 @@
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else if(istype(O, /turf)) else if(isturf(O))
for(var/turf/A in world) for(var/turf/A in world)
if (A.type == O.type) if (A.type == O.type)
if(variable=="luminosity") if(variable=="luminosity")
@@ -374,7 +374,7 @@
if(new_value == null) return if(new_value == null) return
O.vars[variable] = new_value O.vars[variable] = new_value
if(method) if(method)
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if ( istype(M , O.type) ) if ( istype(M , O.type) )
M.vars[variable] = O.vars[variable] M.vars[variable] = O.vars[variable]
@@ -386,14 +386,14 @@
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else if(istype(O, /turf)) else if(isturf(O))
for(var/turf/A in world) for(var/turf/A in world)
if ( istype(A , O.type) ) if ( istype(A , O.type) )
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else else
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if (M.type == O.type) if (M.type == O.type)
M.vars[variable] = O.vars[variable] M.vars[variable] = O.vars[variable]
@@ -405,7 +405,7 @@
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else if(istype(O, /turf)) else if(isturf(O))
for(var/turf/A in world) for(var/turf/A in world)
if (A.type == O.type) if (A.type == O.type)
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
@@ -417,25 +417,25 @@
O.vars[variable] = new_value O.vars[variable] = new_value
if(method) if(method)
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if ( istype(M , O.type) ) if ( istype(M , O.type) )
M.vars[variable] = O.vars[variable] M.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else if(isobj(O.type)) else if(isobj(O))
for(var/obj/A in world) for(var/obj/A in world)
if ( istype(A , O.type) ) if ( istype(A , O.type) )
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else if(istype(O.type, /turf)) else if(isturf(O))
for(var/turf/A in world) for(var/turf/A in world)
if ( istype(A , O.type) ) if ( istype(A , O.type) )
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else else
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if (M.type == O.type) if (M.type == O.type)
M.vars[variable] = O.vars[variable] M.vars[variable] = O.vars[variable]
@@ -447,7 +447,7 @@
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else if(istype(O, /turf)) else if(isturf(O))
for(var/turf/A in world) for(var/turf/A in world)
if (A.type == O.type) if (A.type == O.type)
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
@@ -458,7 +458,7 @@
if(new_value == null) return if(new_value == null) return
O.vars[variable] = new_value O.vars[variable] = new_value
if(method) if(method)
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if ( istype(M , O.type) ) if ( istype(M , O.type) )
M.vars[variable] = O.vars[variable] M.vars[variable] = O.vars[variable]
@@ -470,14 +470,14 @@
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else if(istype(O, /turf)) else if(isturf(O))
for(var/turf/A in world) for(var/turf/A in world)
if ( istype(A , O.type) ) if ( istype(A , O.type) )
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else else
if(istype(O, /mob)) if(ismob(O))
for(var/mob/M in mob_list) for(var/mob/M in mob_list)
if (M.type == O.type) if (M.type == O.type)
M.vars[variable] = O.vars[variable] M.vars[variable] = O.vars[variable]
@@ -489,7 +489,7 @@
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
CHECK_TICK CHECK_TICK
else if(istype(O, /turf)) else if(isturf(O))
for(var/turf/A in world) for(var/turf/A in world)
if (A.type == O.type) if (A.type == O.type)
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]

View File

@@ -150,7 +150,7 @@
SetLuminosity(0) SetLuminosity(0)
SSair.hotspots -= src SSair.hotspots -= src
DestroyTurf() DestroyTurf()
if(istype(loc, /turf)) if(isturf(loc))
var/turf/open/T = loc var/turf/open/T = loc
if(T.active_hotspot == src) if(T.active_hotspot == src)
T.active_hotspot = null T.active_hotspot = null
@@ -159,8 +159,7 @@
return QDEL_HINT_PUTINPOOL return QDEL_HINT_PUTINPOOL
/obj/effect/hotspot/proc/DestroyTurf() /obj/effect/hotspot/proc/DestroyTurf()
if(isturf(loc))
if(istype(loc, /turf))
var/turf/T = loc var/turf/T = loc
if(T.to_be_destroyed) if(T.to_be_destroyed)
var/chance_of_deletion var/chance_of_deletion

View File

@@ -92,7 +92,7 @@
return adjacent_turfs return adjacent_turfs
/atom/proc/air_update_turf(command = 0) /atom/proc/air_update_turf(command = 0)
if(!istype(loc,/turf) && command) if(!isturf(loc) && command)
return return
var/turf/T = get_turf(loc) var/turf/T = get_turf(loc)
T.air_update_turf(command) T.air_update_turf(command)
@@ -103,7 +103,7 @@
SSair.add_to_active(src,command) SSair.add_to_active(src,command)
/atom/movable/proc/move_update_air(turf/T) /atom/movable/proc/move_update_air(turf/T)
if(istype(T,/turf)) if(isturf(T))
T.air_update_turf(1) T.air_update_turf(1)
air_update_turf(1) air_update_turf(1)

View File

@@ -20,7 +20,7 @@
/obj/machinery/zvent/process_atmos() /obj/machinery/zvent/process_atmos()
//all this object does, is make its turf share air with the ones above and below it, if they have a vent too. //all this object does, is make its turf share air with the ones above and below it, if they have a vent too.
if (istype(loc,/turf)) //if we're not on a valid turf, forget it if(isturf(loc)) //if we're not on a valid turf, forget it
for (var/new_z in list(-1,1)) //change this list if a fancier system of z-levels gets implemented for (var/new_z in list(-1,1)) //change this list if a fancier system of z-levels gets implemented
var/turf/open/zturf_conn = locate(x,y,z+new_z) var/turf/open/zturf_conn = locate(x,y,z+new_z)
if (istype(zturf_conn)) if (istype(zturf_conn))

View File

@@ -38,7 +38,7 @@
..() ..()
/obj/machinery/atmospherics/pipe/hide(i) /obj/machinery/atmospherics/pipe/hide(i)
if(level == 1 && istype(loc, /turf)) if(level == 1 && isturf(loc))
invisibility = i ? INVISIBILITY_MAXIMUM : 0 invisibility = i ? INVISIBILITY_MAXIMUM : 0
update_icon() update_icon()
@@ -102,4 +102,4 @@
/obj/machinery/atmospherics/pipe/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir) /obj/machinery/atmospherics/pipe/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee" && damage_amount < 12) if(damage_flag == "melee" && damage_amount < 12)
return 0 return 0
. = ..() . = ..()

View File

@@ -63,7 +63,7 @@
if(M.is_holding(src) || M.head == src) if(M.is_holding(src) || M.head == src)
location = M.loc location = M.loc
if (istype(location, /turf)) if(isturf(location))
location.hotspot_expose(700, 1) location.hotspot_expose(700, 1)
/obj/item/clothing/head/hardhat/cakehat/turn_on() /obj/item/clothing/head/hardhat/cakehat/turn_on()

View File

@@ -62,7 +62,7 @@
. = list() . = list()
for(var/obj/item/I in user.held_items) for(var/obj/item/I in user.held_items)
. += I . += I
if(!istype(user.loc, /turf)) if(!isturf(user.loc))
return return
var/list/L = block(get_step(user, SOUTHWEST), get_step(user, NORTHEAST)) var/list/L = block(get_step(user, SOUTHWEST), get_step(user, NORTHEAST))
for(var/A in L) for(var/A in L)

View File

@@ -531,7 +531,7 @@
/obj/item/weapon/twohanded/required/mining_hammer/afterattack(atom/target, mob/user, proximity_flag) /obj/item/weapon/twohanded/required/mining_hammer/afterattack(atom/target, mob/user, proximity_flag)
if(!proximity_flag && charged)//Mark a target, or mine a tile. if(!proximity_flag && charged)//Mark a target, or mine a tile.
var/turf/proj_turf = get_turf(src) var/turf/proj_turf = get_turf(src)
if(!istype(proj_turf, /turf)) if(!isturf(proj_turf))
return return
var/datum/gas_mixture/environment = proj_turf.return_air() var/datum/gas_mixture/environment = proj_turf.return_air()
var/pressure = environment.return_pressure() var/pressure = environment.return_pressure()

View File

@@ -394,7 +394,7 @@
if (istype(P, /obj/item/weapon/pickaxe)) if (istype(P, /obj/item/weapon/pickaxe))
var/turf/T = user.loc var/turf/T = user.loc
if (!( istype(T, /turf) )) if (!isturf(T))
return return
if(last_act+P.digspeed > world.time)//prevents message spam if(last_act+P.digspeed > world.time)//prevents message spam
@@ -553,7 +553,7 @@
digging_speed = P.digspeed digging_speed = P.digspeed
if (digging_speed) if (digging_speed)
var/turf/T = user.loc var/turf/T = user.loc
if (!( istype(T, /turf) )) if(!isturf(T))
return return
if (dug) if (dug)

View File

@@ -18,7 +18,7 @@ In all, this is a lot like the monkey code. /N
M << "You cannot attack people before the game has started." M << "You cannot attack people before the game has started."
return return
if (istype(loc, /turf) && istype(loc.loc, /area/start)) if(isturf(loc) && istype(loc.loc, /area/start))
M << "No attacking people at spawn, you jackass." M << "No attacking people at spawn, you jackass."
return return
@@ -125,4 +125,4 @@ In all, this is a lot like the monkey code. /N
return 0 return 0
/mob/living/carbon/alien/acid_act(acidpwr, acid_volume) /mob/living/carbon/alien/acid_act(acidpwr, acid_volume)
return 0//aliens are immune to acid. return 0//aliens are immune to acid.

View File

@@ -208,7 +208,7 @@
M << "You cannot attack people before the game has started." M << "You cannot attack people before the game has started."
return 0 return 0
if (istype(loc, /turf) && istype(loc.loc, /area/start)) if(isturf(loc) && istype(loc.loc, /area/start))
M << "No attacking people at spawn, you jackass." M << "No attacking people at spawn, you jackass."
return 0 return 0
@@ -252,7 +252,7 @@
M << "You cannot attack people before the game has started." M << "You cannot attack people before the game has started."
return 0 return 0
if (istype(loc, /turf) && istype(loc.loc, /area/start)) if(isturf(loc) && istype(loc.loc, /area/start))
M << "No attacking people at spawn, you jackass." M << "No attacking people at spawn, you jackass."
return 0 return 0

View File

@@ -110,7 +110,7 @@ var/list/ai_list = list()
radio = new /obj/item/device/radio/headset/ai(src) radio = new /obj/item/device/radio/headset/ai(src)
aicamera = new/obj/item/device/camera/siliconcam/ai_camera(src) aicamera = new/obj/item/device/camera/siliconcam/ai_camera(src)
if (istype(loc, /turf)) if(isturf(loc))
verbs.Add(/mob/living/silicon/ai/proc/ai_network_change, \ verbs.Add(/mob/living/silicon/ai/proc/ai_network_change, \
/mob/living/silicon/ai/proc/ai_statuschange, /mob/living/silicon/ai/proc/ai_hologram_change, \ /mob/living/silicon/ai/proc/ai_statuschange, /mob/living/silicon/ai/proc/ai_hologram_change, \
/mob/living/silicon/ai/proc/toggle_camera_light, /mob/living/silicon/ai/proc/botcall,\ /mob/living/silicon/ai/proc/toggle_camera_light, /mob/living/silicon/ai/proc/botcall,\

View File

@@ -499,7 +499,7 @@
var/mob/living/M = card.loc var/mob/living/M = card.loc
if(!isliving(M)) if(!isliving(M))
while(!isliving(M)) while(!isliving(M))
if(istype(M, /turf)) if(isturf(M))
src.temp = "Error: No biological host found. <br>" src.temp = "Error: No biological host found. <br>"
src.subscreen = 0 src.subscreen = 0
return dat return dat

View File

@@ -418,19 +418,15 @@ Auto Patrol[]"},
return return
lastfired = world.time lastfired = world.time
var/turf/T = loc var/turf/T = loc
var/atom/U = (istype(target, /atom/movable) ? target.loc : target) var/turf/U = get_turf(target)
if((!( U ) || !( T ))) if(!U)
return return
while(!(istype(U, /turf))) if(!isturf(T))
U = U.loc
if(!(istype(T, /turf)))
return return
if(!projectile) if(!projectile)
return return
if(!(istype(U, /turf)))
return
var/obj/item/projectile/A = new projectile (loc) var/obj/item/projectile/A = new projectile (loc)
playsound(loc, shoot_sound, 50, 1) playsound(loc, shoot_sound, 50, 1)
A.current = U A.current = U

View File

@@ -225,7 +225,7 @@
if(target) if(target)
if(path.len == 0) if(path.len == 0)
if(!istype(target, /turf/)) if(!isturf(target))
var/turf/TL = get_turf(target) var/turf/TL = get_turf(target)
path = get_path_to(src, TL, /turf/proc/Distance_cardinal, 0, 30, id=access_card,simulated_only = 0) path = get_path_to(src, TL, /turf/proc/Distance_cardinal, 0, 30, id=access_card,simulated_only = 0)
else else
@@ -248,7 +248,7 @@
target = null target = null
path = list() path = list()
return return
if(istype(target, /turf/) && emagged < 2) if(isturf(target) && emagged < 2)
repair(target) repair(target)
else if(emagged == 2 && isfloorturf(target)) else if(emagged == 2 && isfloorturf(target))
var/turf/open/floor/F = target var/turf/open/floor/F = target

View File

@@ -474,7 +474,7 @@ var/global/mulebot_count = 0
if(next == loc) if(next == loc)
path -= next path -= next
return return
if(istype( next, /turf)) if(isturf(next))
//world << "at ([x],[y]) moving to ([next.x],[next.y])" //world << "at ([x],[y]) moving to ([next.x],[next.y])"
if(bloodiness) if(bloodiness)

View File

@@ -214,7 +214,7 @@
walk(src,0) walk(src,0)
if(do_after(src, 50, target = src)) if(do_after(src, 50, target = src))
if(busy == SPINNING_COCOON) if(busy == SPINNING_COCOON)
if(cocoon_target && istype(cocoon_target.loc, /turf) && get_dist(src,cocoon_target) <= 1) if(cocoon_target && isturf(cocoon_target.loc) && get_dist(src,cocoon_target) <= 1)
var/obj/structure/spider/cocoon/C = new(cocoon_target.loc) var/obj/structure/spider/cocoon/C = new(cocoon_target.loc)
var/large_cocoon = 0 var/large_cocoon = 0
C.pixel_x = cocoon_target.pixel_x C.pixel_x = cocoon_target.pixel_x

View File

@@ -459,7 +459,7 @@
/mob/living/simple_animal/hostile/asteroid/goliath/OpenFire() /mob/living/simple_animal/hostile/asteroid/goliath/OpenFire()
var/tturf = get_turf(target) var/tturf = get_turf(target)
if(!(istype(tturf, /turf))) if(!isturf(tturf))
return return
if(get_dist(src, target) <= 7)//Screen range check, so you can't get tentacle'd offscreen if(get_dist(src, target) <= 7)//Screen range check, so you can't get tentacle'd offscreen
visible_message("<span class='warning'>The [src.name] digs its tentacles under [target.name]!</span>") visible_message("<span class='warning'>The [src.name] digs its tentacles under [target.name]!</span>")

View File

@@ -116,7 +116,7 @@ By design, d1 is the smallest direction and d2 is the highest
//If underfloor, hide the cable //If underfloor, hide the cable
/obj/structure/cable/hide(i) /obj/structure/cable/hide(i)
if(level == 1 && istype(loc, /turf)) if(level == 1 && isturf(loc))
invisibility = i ? INVISIBILITY_MAXIMUM : 0 invisibility = i ? INVISIBILITY_MAXIMUM : 0
updateicon() updateicon()

View File

@@ -48,7 +48,7 @@
/obj/machinery/power/terminal/proc/dismantle(mob/living/user) /obj/machinery/power/terminal/proc/dismantle(mob/living/user)
if(istype(loc, /turf)) if(isturf(loc))
var/turf/T = loc var/turf/T = loc
if(T.intact) if(T.intact)
user << "<span class='warning'>You must first expose the power terminal!</span>" user << "<span class='warning'>You must first expose the power terminal!</span>"

View File

@@ -147,7 +147,7 @@
KA.modify_projectile(BB) KA.modify_projectile(BB)
var/turf/proj_turf = get_turf(BB) var/turf/proj_turf = get_turf(BB)
if(!istype(proj_turf, /turf)) if(!isturf(proj_turf))
return return
var/datum/gas_mixture/environment = proj_turf.return_air() var/datum/gas_mixture/environment = proj_turf.return_air()
var/pressure = environment.return_pressure() var/pressure = environment.return_pressure()

View File

@@ -66,7 +66,7 @@
/obj/item/projectile/beam/pulse/on_hit(atom/target, blocked = 0) /obj/item/projectile/beam/pulse/on_hit(atom/target, blocked = 0)
. = ..() . = ..()
if(istype(target,/turf/)||istype(target,/obj/structure/)) if(isturf(target) || istype(target,/obj/structure/))
target.ex_act(2) target.ex_act(2)
/obj/item/projectile/beam/pulse/shot /obj/item/projectile/beam/pulse/shot

View File

@@ -171,7 +171,7 @@
/obj/item/projectile/plasma/New() /obj/item/projectile/plasma/New()
var/turf/proj_turf = get_turf(src) var/turf/proj_turf = get_turf(src)
if(!istype(proj_turf, /turf)) if(!isturf(proj_turf))
return return
var/datum/gas_mixture/environment = proj_turf.return_air() var/datum/gas_mixture/environment = proj_turf.return_air()
if(environment) if(environment)

View File

@@ -6,7 +6,7 @@
proc/chem_splash(turf/epicenter, affected_range = 3, list/datum/reagents/reactants = list(), extra_heat = 0, threatscale = 1, adminlog = 1) proc/chem_splash(turf/epicenter, affected_range = 3, list/datum/reagents/reactants = list(), extra_heat = 0, threatscale = 1, adminlog = 1)
if(!istype(epicenter, /turf) || !reactants.len || threatscale <= 0) if(!isturf(epicenter) || !reactants.len || threatscale <= 0)
return return
var/has_reagents var/has_reagents
var/total_reagents var/total_reagents

View File

@@ -121,7 +121,7 @@
/obj/machinery/disposal/proc/stuff_mob_in(mob/living/target, mob/living/user) /obj/machinery/disposal/proc/stuff_mob_in(mob/living/target, mob/living/user)
if(!iscarbon(user) && !user.ventcrawler) //only carbon and ventcrawlers can climb into disposal by themselves. if(!iscarbon(user) && !user.ventcrawler) //only carbon and ventcrawlers can climb into disposal by themselves.
return return
if(!istype(user.loc, /turf/)) //No magically doing it from inside closets if(!isturf(user.loc)) //No magically doing it from inside closets
return return
if(target.buckled || target.has_buckled_mobs()) if(target.buckled || target.has_buckled_mobs())
return return

View File

@@ -251,7 +251,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
var/location var/location
if(isliving(target)) if(isliving(target))
location = target.loc location = target.loc
else if(istype(target,/turf)) else if(isturf(target))
location = target location = target
var/obj/effect/overlay/spell = new /obj/effect/overlay(location) var/obj/effect/overlay/spell = new /obj/effect/overlay(location)
spell.icon = overlay_icon spell.icon = overlay_icon
@@ -265,7 +265,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
var/location var/location
if(isliving(target)) if(isliving(target))
location = target.loc location = target.loc
else if(istype(target,/turf)) else if(isturf(target))
location = target location = target
if(isliving(target) && message) if(isliving(target) && message)
target << text("[message]") target << text("[message]")