Skip to content

Commit

Permalink
ismachinery define
Browse files Browse the repository at this point in the history
  • Loading branch information
imtakingabreakdontatme committed Oct 3, 2017
1 parent a215c88 commit 7238974
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/blob/blob_report.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/holodeck/area_copy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_animal/hostile/mimic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/modular_computers/hardware/recharger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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, "<span class='warning'>\The [src] is incompatible with portable computers!</span>")
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))
Expand Down
6 changes: 3 additions & 3 deletions code/modules/power/singularity/containment_field.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 ..()

Expand Down
2 changes: 1 addition & 1 deletion code/modules/power/tesla/energy_ball.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7238974

Please sign in to comment.