Merge pull request #3473 from Citadel-Station-13/upstream-merge-31809

[MIRROR] Cleans up some istypes not using helpers
This commit is contained in:
LetterJay
2017-10-18 07:37:43 -04:00
committed by GitHub
18 changed files with 26 additions and 24 deletions

View File

@@ -31,7 +31,7 @@
var/turf/T = loc
if(istype(T))
if(istype(T, /turf/open/lava))
if(islava(T))
environment_temperature = 5000
else if(T.blocks_air)
environment_temperature = T.temperature

View File

@@ -287,11 +287,11 @@
anchored = TRUE
if(PLACE_TILE)
F = scan_target
if(istype(F, /turf/open/floor/plating)) //The floor must not already have a tile.
if(isplatingturf(F)) //The floor must not already have a tile.
result = F
if(REPLACE_TILE)
F = scan_target
if(isfloorturf(F) && !istype(F, /turf/open/floor/plating)) //The floor must already have a tile.
if(isfloorturf(F) && !isplatingturf(F)) //The floor must already have a tile.
result = F
if(FIX_TILE) //Selects only damaged floors.
F = scan_target
@@ -299,7 +299,7 @@
result = F
if(TILE_EMAG) //Emag mode! Rip up the floor and cause breaches to space!
F = scan_target
if(!istype(F, /turf/open/floor/plating))
if(!isplatingturf(F))
result = F
else //If no special processing is needed, simply return the result.
result = scan_target
@@ -329,7 +329,7 @@
else
var/turf/open/floor/F = target_turf
if(F.type != initial(tiletype.turf_type) && (F.broken || F.burnt || istype(F, /turf/open/floor/plating)) || F.type == (initial(tiletype.turf_type) && (F.broken || F.burnt)))
if(F.type != initial(tiletype.turf_type) && (F.broken || F.burnt || isplatingturf(F)) || F.type == (initial(tiletype.turf_type) && (F.broken || F.burnt)))
anchored = TRUE
icon_state = "floorbot-c"
mode = BOT_REPAIRING
@@ -340,7 +340,7 @@
F.burnt = 0
F.ChangeTurf(/turf/open/floor/plasteel)
if(replacetiles && F.type != initial(tiletype.turf_type) && specialtiles && !istype(F, /turf/open/floor/plating))
if(replacetiles && F.type != initial(tiletype.turf_type) && specialtiles && !isplatingturf(F))
anchored = TRUE
icon_state = "floorbot-c"
mode = BOT_REPAIRING

View File

@@ -93,7 +93,7 @@ Difficulty: Medium
return ..()
/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner/Move(atom/newloc)
if(dashing || (newloc && newloc.z == z && (istype(newloc, /turf/open/lava) || istype(newloc, /turf/open/chasm)))) //we're not stupid!
if(dashing || (newloc && newloc.z == z && (islava(newloc) || ischasm(newloc)))) //we're not stupid!
return FALSE
return ..()
@@ -186,7 +186,7 @@ Difficulty: Medium
var/turf_dist_to_target = 0
if(!QDELETED(dash_target))
turf_dist_to_target += get_dist(dash_target, O)
if(get_dist(src, O) >= MINER_DASH_RANGE && turf_dist_to_target <= self_dist_to_target && !istype(O, /turf/open/lava) && !istype(O, /turf/open/chasm))
if(get_dist(src, O) >= MINER_DASH_RANGE && turf_dist_to_target <= self_dist_to_target && !islava(O) && !ischasm(O))
var/valid = TRUE
for(var/turf/T in getline(own_turf, O))
if(is_blocked_turf(T, TRUE))

View File

@@ -137,14 +137,14 @@ GLOBAL_LIST_INIT(AISwarmerCapsByType, list(/mob/living/simple_animal/hostile/swa
/mob/living/simple_animal/hostile/swarmer/ai/Move(atom/newloc)
if(newloc)
if(newloc.z == z) //so these actions are Z-specific
if(istype(newloc, /turf/open/lava))
if(islava(newloc))
var/turf/open/lava/L = newloc
if(!L.is_safe())
StartAction(20)
new /obj/structure/lattice/catwalk/swarmer_catwalk(newloc)
return FALSE
if(istype(newloc, /turf/open/chasm) && !throwing)
if(ischasm(newloc) && !throwing)
throw_at(get_edge_target_turf(src, get_dir(src, newloc)), 7 , 3, spin = FALSE) //my planet needs me
return FALSE

View File

@@ -509,7 +509,7 @@
if(wall_pierce++ < wall_pierce_amount)
loc = target
if(prob(wall_devastate))
if(istype(target, /turf/closed/wall))
if(iswallturf(target))
var/turf/closed/wall/W = target
W.dismantle_wall(TRUE, TRUE)
else

View File

@@ -101,7 +101,7 @@
/obj/item/projectile/proc/on_hit(atom/target, blocked = FALSE)
var/turf/target_loca = get_turf(target)
if(!nodamage && (damage_type == BRUTE || damage_type == BURN) && istype(target_loca, /turf/closed/wall) && prob(75))
if(!nodamage && (damage_type == BRUTE || damage_type == BURN) && iswallturf(target_loca) && prob(75))
var/turf/closed/wall/W = target_loca
var/mutable_appearance/decal = mutable_appearance('icons/effects/effects.dmi', "bullet_hole", TURF_DECAL_LAYER)
if(target == original)

View File

@@ -76,7 +76,7 @@
OpenDoor(target)
else
var/turf/T = get_turf(target)
if(isclosedturf(T) && !istype(T, /turf/closed/indestructible))
if(isclosedturf(T) && !isindestructiblewall(T))
CreateDoor(T)
/obj/item/projectile/magic/door/proc/CreateDoor(turf/T)

View File

@@ -1330,7 +1330,7 @@
taste_description = "carpet" // Your tounge feels furry.
/datum/reagent/carpet/reaction_turf(turf/T, reac_volume)
if(istype(T, /turf/open/floor/plating) || istype(T, /turf/open/floor/plasteel))
if(isplatingturf(T) || istype(T, /turf/open/floor/plasteel))
var/turf/open/floor/F = T
F.ChangeTurf(/turf/open/floor/carpet)
..()

View File

@@ -54,7 +54,7 @@
. = 1
/datum/reagent/clf3/reaction_turf(turf/T, reac_volume)
if(istype(T, /turf/open/floor/plating))
if(isplatingturf(T))
var/turf/open/floor/plating/F = T
if(prob(10 + F.burnt + 5*F.broken)) //broken or burnt plating is more susceptible to being destroyed
F.ChangeTurf(F.baseturf)

View File

@@ -263,7 +263,7 @@ GLOBAL_DATUM(necropolis_gate, /obj/structure/necropolis_gate/legion_gate)
if(falling || fallen)
return
var/turf/T = get_turf(src)
if(!istype(T, /turf/open/lava) && !istype(T, /turf/open/chasm)) //nothing to sink or fall into
if(!islava(T) && !ischasm(T)) //nothing to sink or fall into
return
var/obj/item/I
if(istype(AM, /obj/item))