diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 2dad9291f2af6..a77e26d54156c 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -138,6 +138,8 @@ #define isstructure(A) (istype(A, /obj/structure)) +#define ismachinery(A) (istype(A, /obj/machinery)) + #define ismecha(A) (istype(A, /obj/mecha)) #define is_cleanable(A) (istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/rune)) //if something is cleanable diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm index b6d31b1d5b1bc..5801da1e60326 100644 --- a/code/game/gamemodes/blob/blob_report.dm +++ b/code/game/gamemodes/blob/blob_report.dm @@ -85,7 +85,7 @@ src.grille += 1 else if(istype(O, /obj/machinery/door)) src.door += 1 - else if(istype(O, /obj/machinery)) + else if(ismachinery(O)) src.mach += 1 if(count_territories) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index dffa22670c6d1..f2537945dbf37 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -51,7 +51,7 @@ T.add_blueprints_preround(src) /obj/Destroy(force=FALSE) - if(!istype(src, /obj/machinery)) + if(!ismachinery(src)) STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists SStgui.close_uis(src) . = ..() diff --git a/code/modules/holodeck/area_copy.dm b/code/modules/holodeck/area_copy.dm index 272fb1c536228..9da772eaee133 100644 --- a/code/modules/holodeck/area_copy.dm +++ b/code/modules/holodeck/area_copy.dm @@ -31,7 +31,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list("tag","area","type","loc","locs", I.damtype = STAMINA // thou shalt not N.update_icon() - if(istype(O, /obj/machinery)) + if(ismachinery(O)) var/obj/machinery/M = O M.power_change() diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 3f92f87a3f946..be7b5751d81a0 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -274,7 +274,7 @@ if(O.anchored) continue - if(isitem(O) || isstructure(O) || istype(O, /obj/machinery)) + if(isitem(O) || isstructure(O) || ismachinery(O)) cocoon_target = O busy = MOVING_TO_TARGET stop_automated_movement = 1 diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index b46000c339913..edcf1a0f73a7e 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -144,7 +144,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca icon_living = icon_state copy_overlays(O) add_overlay(googly_eyes) - if(isstructure(O) || istype(O, /obj/machinery)) + if(isstructure(O) || ismachinery(O)) health = (anchored * 50) + 50 destroy_objects = 1 if(O.density && O.anchored) diff --git a/code/modules/modular_computers/hardware/recharger.dm b/code/modules/modular_computers/hardware/recharger.dm index 08ecc6e8c8aab..7096233d3a674 100644 --- a/code/modules/modular_computers/hardware/recharger.dm +++ b/code/modules/modular_computers/hardware/recharger.dm @@ -31,7 +31,7 @@ origin_tech = "programming=2;engineering=2;powerstorage=3" /obj/item/computer_hardware/recharger/APC/use_power(amount, charging=0) - if(istype(holder.physical, /obj/machinery)) + if(ismachinery(holder.physical)) var/obj/machinery/M = holder.physical if(M.powered()) M.use_power(amount) @@ -55,13 +55,13 @@ origin_tech = "engineering=2;powerstorage=1" /obj/item/computer_hardware/recharger/wired/can_install(obj/item/device/modular_computer/M, mob/living/user = null) - if(istype(M.physical, /obj/machinery) && M.physical.anchored) + if(ismachinery(M.physical) && M.physical.anchored) return ..() to_chat(user, "\The [src] is incompatible with portable computers!") return 0 /obj/item/computer_hardware/recharger/wired/use_power(amount, charging=0) - if(istype(holder.physical, /obj/machinery) && holder.physical.anchored) + if(ismachinery(holder.physical) && holder.physical.anchored) var/obj/machinery/M = holder.physical var/turf/T = M.loc if(!T || !istype(T)) diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index f2610f97b0e38..f4d09167c8487 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -58,7 +58,7 @@ if(isliving(mover)) shock(mover) - if(istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover)) + if(ismachinery(mover) || isstructure(mover) || ismecha(mover)) bump_field(mover) /obj/machinery/field/containment/proc/set_master(master1,master2) @@ -90,13 +90,13 @@ if(isliving(mover)) shock(mover) return - if(istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover)) + if(ismachinery(mover) || isstructure(mover) || ismecha(mover)) bump_field(mover) return /obj/machinery/field/CanPass(atom/movable/mover, turf/target) - if(hasShocked || isliving(mover) || istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover)) + if(hasShocked || isliving(mover) || ismachinery(mover) || isstructure(mover) || ismecha(mover)) return FALSE return ..() diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index d8d396d311415..503196aa4e733 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -222,7 +222,7 @@ else if(closest_mob) continue - else if(istype(A, /obj/machinery)) + else if(ismachinery(A)) var/obj/machinery/M = A var/dist = get_dist(source, A) if(dist <= zap_range && (dist < closest_dist || !closest_machine) && !M.being_shocked)