Skip to content

Commit

Permalink
[MIRROR] Makes vending machines no longer crush chairs - fixed (#1180)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Makes vending machines no longer crush chairs - fixed

---------

Co-authored-by: KingkumaArt <[email protected]>
Co-authored-by: san7890 <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Feb 27, 2024
1 parent 958f76d commit 515a507
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion code/modules/vending/_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 515a507

Please sign in to comment.