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

🆑
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.
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
This commit is contained in:
KingkumaArt
2024-02-27 15:01:24 +01:00
committed by GitHub
co-authored by san7890
parent 0893aef2fd
commit 42a657169d
+16 -1
View File
@@ -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)