Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Machinery Destroy() side effect clean up #2911

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

Steals-The-PRs
Copy link
Collaborator

Mirrored on Nova: NovaSector/NovaSector#2011
Original PR: tgstation/tgstation#82659

About The Pull Request

I have combed over implementations of Destroy() for obj/machinery, and noticed quite a few was spawning items or playing sounds.

Slot machines:
Moved payout to on_deconstruction()

Windoors:
Break sound moved to on_deconstruction().
I have also slightly cleaned up Destroy(), the windoor calls air_update_turf directly, as that proc already retrieves the turf it is on.

Atmospheric pipe:
Releases air and deconstructs meter objects on_deconstruction().

Portable atmospheric devices:
Drop hyper noblium crystal on on_destruction().

Pump, Scrubbers:
Releases air on_deconstruction().

PACMAN power generator:
Spawns dropped fuel on_deconstruction().

Runic vendor:
Moved vanishing effects to on_deconstruction().

I did not change Destroy side effects in the following instances:

  • side effects are critical for the round (e.g. doomsday device, nuke, blackbox recorder dropping the tape, gulag item reclaimer [less critical but still])
  • might spawn messages and noises, but moving them to on_deconstruct would put linked items into an unusable state if deleted directly (e.g. express order console, cyborg lockdown console, tram paired sensors)
  • would potentially delete mobs we don't want deleted (e.g. disposals, slime camera console)

Out of 220 Destroy defines, I found only 8 side effects that could not be moved to other procs, so machinery\Destroy() has almost always been used properly! I really hope structure will be as well made.

Other changes:

  • Stasis beds had a completely empty destroy, removed
  • Mass drivers had two destroy procs, merged

Why It's Good For The Game

The Destroy() proc should only contain reference clean ups, barring edge cases that would harm playability.

Changelog

Nothing player facing.

* Machinery Destroy() side effect clean up (#82659)

## About The Pull Request

I have combed over implementations of `Destroy()` for `obj/machinery`,
and noticed quite a few was spawning items or playing sounds.

**Slot machines**:
Moved payout to on_deconstruction()

**Windoors**:
Break sound moved to on_deconstruction().
I have also slightly cleaned up Destroy(), the windoor calls
air_update_turf directly, as that proc already retrieves the turf it is
on.
 
**Atmospheric pipe**:
Releases air and deconstructs meter objects on_deconstruction().

**Portable atmospheric devices**:
Drop hyper noblium crystal on on_destruction().

**Pump, Scrubbers**:
Releases air on_deconstruction().

**PACMAN power generator**:
Spawns dropped fuel on_deconstruction().

**Runic vendor**:
Moved vanishing effects to on_deconstruction().

I did not change Destroy side effects in the following instances:

- side effects are critical for the round (e.g. doomsday device, nuke,
blackbox recorder dropping the tape, gulag item reclaimer [less critical
but still])
- might spawn messages and noises, but moving them to on_deconstruct
would put linked items into an unusable state if deleted directly (e.g.
express order console, cyborg lockdown console, tram paired sensors)
- would potentially delete mobs we don't want deleted (e.g. disposals,
slime camera console)

Out of 220 Destroy defines, I found only 8 side effects that could not
be moved to other procs, so `machinery\Destroy()` has almost always been
used properly! I really hope `structure` will be as well made.

Other changes:

- Stasis beds had a completely empty destroy, removed
- Mass drivers had two destroy procs, merged

## Why It's Good For The Game

The Destroy() proc should only contain reference clean ups, barring edge
cases that would harm playability.

## Changelog

Nothing player facing.

* Machinery Destroy() side effect clean up

---------

Co-authored-by: Profakos <[email protected]>
@Iajret Iajret merged commit a3eda35 into master Apr 16, 2024
27 checks passed
@Iajret Iajret deleted the upstream-mirror-2011 branch April 16, 2024 13:15
Iajret pushed a commit that referenced this pull request Jun 8, 2024
… IGNORE] (#2911)

* [no gbp] fixes lobstrosities fishing infinite resources (#83661)

## About The Pull Request
fixes lobstrosities being able to fish tons of resources, closes #83565

## Why It's Good For The Game
fixes the fishing economy

## Changelog
:cl:
fix: lobstrosities will no longer be able to fish out multiple
necropolis chests
/:cl:

* [no gbp] fixes lobstrosities fishing infinite resources

---------

Co-authored-by: Ben10Omintrix <[email protected]>
Co-authored-by: NovaBot13 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants