Merge pull request #31809 from ShizCalev/helper-cleanup

Cleans up some istypes not using helpers
This commit is contained in:
Leo
2017-10-17 22:20:42 -02:00
committed by CitadelStationBot
parent 9691c9130f
commit 28656d3347
18 changed files with 26 additions and 24 deletions
@@ -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
@@ -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))
@@ -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