Merge pull request #31286 from KorPhaeron/ismachinery

ismachinery define
This commit is contained in:
Leo
2017-10-04 21:25:31 -03:00
committed by CitadelStationBot
parent 2d27df3adc
commit 39cf9bb7a0
9 changed files with 14 additions and 12 deletions

View File

@@ -140,6 +140,8 @@
#define isstructure(A) (istype(A, /obj/structure)) #define isstructure(A) (istype(A, /obj/structure))
#define ismachinery(A) (istype(A, /obj/machinery))
#define ismecha(A) (istype(A, /obj/mecha)) #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 #define is_cleanable(A) (istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/rune)) //if something is cleanable

View File

@@ -85,7 +85,7 @@
src.grille += 1 src.grille += 1
else if(istype(O, /obj/machinery/door)) else if(istype(O, /obj/machinery/door))
src.door += 1 src.door += 1
else if(istype(O, /obj/machinery)) else if(ismachinery(O))
src.mach += 1 src.mach += 1
if(count_territories) if(count_territories)

View File

@@ -51,7 +51,7 @@
T.add_blueprints_preround(src) T.add_blueprints_preround(src)
/obj/Destroy(force=FALSE) /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 STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
SStgui.close_uis(src) SStgui.close_uis(src)
. = ..() . = ..()

View File

@@ -31,7 +31,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list("tag","area","type","loc","locs",
I.damtype = STAMINA // thou shalt not I.damtype = STAMINA // thou shalt not
N.update_icon() N.update_icon()
if(istype(O, /obj/machinery)) if(ismachinery(O))
var/obj/machinery/M = O var/obj/machinery/M = O
M.power_change() M.power_change()

View File

@@ -275,7 +275,7 @@
if(O.anchored) if(O.anchored)
continue continue
if(isitem(O) || isstructure(O) || istype(O, /obj/machinery)) if(isitem(O) || isstructure(O) || ismachinery(O))
cocoon_target = O cocoon_target = O
busy = MOVING_TO_TARGET busy = MOVING_TO_TARGET
stop_automated_movement = 1 stop_automated_movement = 1

View File

@@ -144,7 +144,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
icon_living = icon_state icon_living = icon_state
copy_overlays(O) copy_overlays(O)
add_overlay(googly_eyes) add_overlay(googly_eyes)
if(isstructure(O) || istype(O, /obj/machinery)) if(isstructure(O) || ismachinery(O))
health = (anchored * 50) + 50 health = (anchored * 50) + 50
destroy_objects = 1 destroy_objects = 1
if(O.density && O.anchored) if(O.density && O.anchored)

View File

@@ -31,7 +31,7 @@
origin_tech = "programming=2;engineering=2;powerstorage=3" origin_tech = "programming=2;engineering=2;powerstorage=3"
/obj/item/computer_hardware/recharger/APC/use_power(amount, charging=0) /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 var/obj/machinery/M = holder.physical
if(M.powered()) if(M.powered())
M.use_power(amount) M.use_power(amount)
@@ -55,13 +55,13 @@
origin_tech = "engineering=2;powerstorage=1" origin_tech = "engineering=2;powerstorage=1"
/obj/item/computer_hardware/recharger/wired/can_install(obj/item/device/modular_computer/M, mob/living/user = null) /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 ..() return ..()
to_chat(user, "<span class='warning'>\The [src] is incompatible with portable computers!</span>") to_chat(user, "<span class='warning'>\The [src] is incompatible with portable computers!</span>")
return 0 return 0
/obj/item/computer_hardware/recharger/wired/use_power(amount, charging=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/obj/machinery/M = holder.physical
var/turf/T = M.loc var/turf/T = M.loc
if(!T || !istype(T)) if(!T || !istype(T))

View File

@@ -58,7 +58,7 @@
if(isliving(mover)) if(isliving(mover))
shock(mover) shock(mover)
if(istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover)) if(ismachinery(mover) || isstructure(mover) || ismecha(mover))
bump_field(mover) bump_field(mover)
/obj/machinery/field/containment/proc/set_master(master1,master2) /obj/machinery/field/containment/proc/set_master(master1,master2)
@@ -90,13 +90,13 @@
if(isliving(mover)) if(isliving(mover))
shock(mover) shock(mover)
return return
if(istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover)) if(ismachinery(mover) || isstructure(mover) || ismecha(mover))
bump_field(mover) bump_field(mover)
return return
/obj/machinery/field/CanPass(atom/movable/mover, turf/target) /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 FALSE
return ..() return ..()

View File

@@ -222,7 +222,7 @@
else if(closest_mob) else if(closest_mob)
continue continue
else if(istype(A, /obj/machinery)) else if(ismachinery(A))
var/obj/machinery/M = A var/obj/machinery/M = A
var/dist = get_dist(source, A) var/dist = get_dist(source, A)
if(dist <= zap_range && (dist < closest_dist || !closest_machine) && !M.being_shocked) if(dist <= zap_range && (dist < closest_dist || !closest_machine) && !M.being_shocked)