new-frontiers-14 / frontier-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
GNU Affero General Public License v3.0
88 stars 535 forks source link

Raise DroppedEvent on items in pockets/suit storage. #2400

Closed whatston3 closed 1 week ago

whatston3 commented 2 weeks ago

About the PR

Raises a DroppedEvent on all items in dependent inventory slot when unequipping its parent.

Why / Balance

When removing a piece of clothing in an outer slot, the dependent slots' contents (e.g. pockets, suit storage, belt) would not raise a DroppedEvent. Some items (jetpacks, health scanners, etc.) rely on this event to cut down on bookkeeping or maintain state.

Fixes https://discord.com/channels/1123826877245694004/1305455935216549940.

Issues

This fix depends on some existing behaviour - all existing code that raises DroppedEvent removing items from slots through interaction or the like only interacts with the item being dropped directly, ignoring any children (which it doesn't know about from the call). The contents of dependent slots are only removed and relocated without any event.

How to test

  1. Wear an EVA suit (any will work), have a mini jetpack in your suit storage.
  2. Waddle into space, turn your jetpack on.
  3. Spawn another suit, pick it up and wear it.
  4. Jetpack will fall into space.
  5. Try to move, your character will impotently wiggle, the jetpack will remain stationary.

Media

Requirements

Breaking changes

Changelog

Minor fix, difficult to describe to players, no changelog.