diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index c55b8216a3..bd01946239 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -136,6 +136,8 @@ #define isitem(A) (istype(A, /obj/item)) +#define isstructure(A) (istype(A, /obj/structure)) + #define is_cleanable(A) (istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/rune)) //if something is cleanable #define isorgan(A) (istype(A, /obj/item/organ)) @@ -164,9 +166,9 @@ GLOBAL_LIST_INIT(pointed_types, typecacheof(list( #define istimer(O) (istype(O, /obj/item/device/assembly/timer)) GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list( - /obj/item/stack/sheet/glass, - /obj/item/stack/sheet/rglass, - /obj/item/stack/sheet/plasmaglass, + /obj/item/stack/sheet/glass, + /obj/item/stack/sheet/rglass, + /obj/item/stack/sheet/plasmaglass, /obj/item/stack/sheet/plasmarglass))) #define is_glass_sheet(O) (is_type_in_typecache(O, GLOB.glass_sheet_types)) diff --git a/code/datums/forced_movement.dm b/code/datums/forced_movement.dm index 620973487a..33659dcb2b 100644 --- a/code/datums/forced_movement.dm +++ b/code/datums/forced_movement.dm @@ -83,8 +83,16 @@ . = . && (vic.loc != tar.loc) /mob/Collide(atom/A) +<<<<<<< HEAD . = ..() if(force_moving && force_moving.allow_climbing && istype(A, /obj/structure)) var/obj/structure/S = A if(S.climbable) S.do_climb(src) +======= + . = ..() + if(force_moving && force_moving.allow_climbing && isstructure(A)) + var/obj/structure/S = A + if(S.climbable) + S.do_climb(src) +>>>>>>> 7d0f936... Merge pull request #31138 from KorPhaeron/isstructure diff --git a/code/modules/awaymissions/capture_the_flag.dm b/code/modules/awaymissions/capture_the_flag.dm index 2dc38a48f2..0307a6b58e 100644 --- a/code/modules/awaymissions/capture_the_flag.dm +++ b/code/modules/awaymissions/capture_the_flag.dm @@ -320,7 +320,7 @@ for(var/atm in A) if(!is_type_in_typecache(atm, ctf_object_typecache)) qdel(atm) - if(istype(atm, /obj/structure)) + if(isstructure(atm)) var/obj/structure/S = atm S.obj_integrity = S.max_integrity diff --git a/code/modules/mob/living/carbon/human/interactive.dm b/code/modules/mob/living/carbon/human/interactive.dm index 91921f386d..51b65bf44f 100644 --- a/code/modules/mob/living/carbon/human/interactive.dm +++ b/code/modules/mob/living/carbon/human/interactive.dm @@ -667,7 +667,7 @@ equip_to_appropriate_slot(MYID) //THIEVING SKILLS END //-------------TOUCH ME - if(istype(TARGET, /obj/structure)) + if(isstructure(TARGET)) var/obj/structure/STR = TARGET if(main_hand) var/obj/item/W = main_hand diff --git a/code/modules/mob/living/simple_animal/friendly/cockroach.dm b/code/modules/mob/living/simple_animal/friendly/cockroach.dm index 0218ce5726..77c29cd3cf 100644 --- a/code/modules/mob/living/simple_animal/friendly/cockroach.dm +++ b/code/modules/mob/living/simple_animal/friendly/cockroach.dm @@ -42,7 +42,7 @@ else visible_message("[src] avoids getting crushed.") else - if(istype(AM, /obj/structure)) + if(isstructure(AM)) if(prob(squish_chance)) AM.visible_message("[src] was crushed under [AM].") adjustBruteLoss(1) 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 75cc53e0c9..e5ee4f671c 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -275,7 +275,7 @@ if(O.anchored) continue - if(isitem(O) || istype(O, /obj/structure) || istype(O, /obj/machinery)) + if(isitem(O) || isstructure(O) || istype(O, /obj/machinery)) 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 abe095779b..b46000c339 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -130,7 +130,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca faction |= "\ref[owner]" /mob/living/simple_animal/hostile/mimic/copy/proc/CheckObject(obj/O) - if((isitem(O) || istype(O, /obj/structure)) && !is_type_in_list(O, GLOB.protected_objects)) + if((isitem(O) || isstructure(O)) && !is_type_in_list(O, GLOB.protected_objects)) return 1 return 0 @@ -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(istype(O, /obj/structure) || istype(O, /obj/machinery)) + if(isstructure(O) || istype(O, /obj/machinery)) health = (anchored * 50) + 50 destroy_objects = 1 if(O.density && O.anchored) diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index f819b35d75..32967e2537 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -57,8 +57,8 @@ /obj/machinery/field/containment/Crossed(mob/mover) if(isliving(mover)) shock(mover) - - if(istype(mover, /obj/machinery) || istype(mover, /obj/structure) || istype(mover, /obj/mecha)) + + if(istype(mover, /obj/machinery) || isstructure(mover) || istype(mover, /obj/mecha)) 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) || istype(mover, /obj/structure) || istype(mover, /obj/mecha)) + if(istype(mover, /obj/machinery) || isstructure(mover) || istype(mover, /obj/mecha)) bump_field(mover) return /obj/machinery/field/CanPass(atom/movable/mover, turf/target) - if(hasShocked || isliving(mover) || istype(mover, /obj/machinery) || istype(mover, /obj/structure) || istype(mover, /obj/mecha)) + if(hasShocked || isliving(mover) || istype(mover, /obj/machinery) || isstructure(mover) || istype(mover, /obj/mecha)) return FALSE return ..() diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index 6d90a88a33..d8d396d311 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -244,7 +244,7 @@ else if(closest_blob) continue - else if(istype(A, /obj/structure)) + else if(isstructure(A)) var/obj/structure/S = A var/dist = get_dist(source, A) if(dist <= zap_range && (dist < closest_dist || !closest_tesla_coil) && !S.being_shocked) diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index 8c4f80b772..9ebbc06eee 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -293,7 +293,7 @@ ..() /atom/proc/animate_atom_living(var/mob/living/owner = null) - if((isitem(src) || istype(src, /obj/structure)) && !is_type_in_list(src, GLOB.protected_objects)) + if((isitem(src) || isstructure(src)) && !is_type_in_list(src, GLOB.protected_objects)) if(istype(src, /obj/structure/statue/petrified)) var/obj/structure/statue/petrified/P = src if(P.petrified_mob)