From 42a657169dcedfbb7039a0a2c5aae49a36359d95 Mon Sep 17 00:00:00 2001 From: KingkumaArt <69398298+KingkumaArt@users.noreply.github.com> Date: Tue, 27 Feb 2024 09:01:24 -0500 Subject: [PATCH] Makes vending machines no longer crush chairs - fixed (#81653) THIS IS A FIXED VERSION OF PR #79775 Does what it says, vending machines no longer damage chairs or conveyors. Likely an unintended side effect of vendor crushes being updated to do integrity damage. ## Why It's Good For The Game ![cbt](https://github.com/tgstation/tgstation/assets/69398298/c4695266-4bf5-4cfb-a51c-0c63e4e71d50) Jokes aside the fact I have this gif below permanently saved to my pc means it's memorable enough to add back in. Not really a thing that's possible to powergame with either, because there are far easier ways of RRing someone, this is just funny enough to be worth it. ## Changelog :cl: add: a list of items called vendor_nocrush that vendors dont deal integrity damage to upon hitting them. fix: Makes vending machines no longer crush chairs and conveyors. /:cl: --------- Co-authored-by: san7890 --- code/modules/vending/_vending.dm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 3c544552d51..f101c5b2f74 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -821,7 +821,7 @@ post_crush_living(living_target, was_alive) flags_to_return |= (SUCCESSFULLY_CRUSHED_MOB|SUCCESSFULLY_CRUSHED_ATOM) - else if (atom_target.uses_integrity && !(atom_target.invisibility > SEE_INVISIBLE_LIVING) && !(is_type_in_typecache(atom_target, GLOB.WALLITEMS_INTERIOR) || is_type_in_typecache(atom_target, GLOB.WALLITEMS_EXTERIOR))) + else if(check_atom_crushable(atom_target)) atom_target.take_damage(adjusted_damage, damage_type, damage_flag, FALSE, crush_dir) crushed = TRUE flags_to_return |= SUCCESSFULLY_CRUSHED_ATOM @@ -861,6 +861,21 @@ /atom/movable/proc/post_tilt() return +/proc/check_atom_crushable(atom/atom_target) + /// Contains structures and items that vendors shouldn't crush when we land on them. + var/static/list/vendor_uncrushable_objects = list( + /obj/structure/chair, + /obj/machinery/conveyor, + ) + GLOB.WALLITEMS_INTERIOR + GLOB.WALLITEMS_EXTERIOR + + if(is_type_in_list(atom_target, vendor_uncrushable_objects)) //make sure its not in the list of "uncrushable" stuff + return FALSE + + if (atom_target.uses_integrity && !(atom_target.invisibility > SEE_INVISIBLE_LIVING)) //check if it has integrity + allow ninjas, etc to be crushed in cloak + return TRUE //SMUSH IT + + return FALSE + /obj/machinery/vending/post_crush_living(mob/living/crushed, was_alive) if(was_alive && crushed.stat == DEAD && crushed.client)