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] Refactors how machines are deconstructed #1970

Merged
merged 1 commit into from
Feb 14, 2024
Merged

Conversation

Steals-The-PRs
Copy link
Collaborator

Mirrored on Nova: NovaSector/NovaSector#910
Original PR: tgstation/tgstation#81291

About The Pull Request

This refactors how machines are deconstructed in the following ways

  • You can no longer override obj/machinery/deconstruct(). If you want customized behaviour then override on_deconstruction() instead.

    This comes with the added benifit of no longer needing to check for the NO_DECONSTRUCTION flag because the machine base proc does that for us & if it finds that flag it won't proceed to call on_deconstruction() meaning no machine will have a chance to spawn anything which is the current behaviour.

    This is required to make #81290 work for all machines at least so that machine can send the COMSIG_OBJ_DECONSTRUCT signal without subtypes overriding & forgetting to call the parent proc

  • dump_contents() only gets called when the machine is deconstructed not destroyed thus not leaving behind any of its contents inside. Fixes Material container drops sheets only on object deconstruct & not destroy. tgstation/tgstation#81290 (comment)

Changelog

🆑 SyncIt21
fix: machines that should not drop contents when deleted no longer do.
refactor: refactors how machines are deconstructed. report bugs on github.
/:cl:

* Refactors how machines are deconstructed (#81291)

## About The Pull Request
This refactors how machines are deconstructed in the following ways

- You can no longer override `obj/machinery/deconstruct()`. If you want
customized behaviour then override `on_deconstruction()` instead.

This comes with the added benifit of no longer needing to check for the
`NO_DECONSTRUCTION` flag because the machine base proc does that for us
& if it finds that flag it won't proceed to call `on_deconstruction()`
meaning no machine will have a chance to spawn anything which is the
current behaviour.

This is required to make #81290 work for all machines at least so that
machine can send the `COMSIG_OBJ_DECONSTRUCT` signal without subtypes
overriding & forgetting to call the parent proc

- `dump_contents()` only gets called when the machine is deconstructed
not destroyed thus not leaving behind any of its contents inside. Fixes
tgstation/tgstation#81290 (comment)

## Changelog
:cl:
fix: machines that should not drop contents when deleted no longer do.
refactor: refactors how machines are deconstructed. report bugs on
github.
/:cl:

---------

Co-authored-by: MrMelbert <[email protected]>

* Refactors how machines are deconstructed

* Update modular procs

* Update multi_cell_charger.dm

---------

Co-authored-by: SyncIt21 <[email protected]>
Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: Mal <[email protected]>
@Iajret Iajret merged commit bb1fa5d into master Feb 14, 2024
24 checks passed
@Iajret Iajret deleted the upstream-mirror-910 branch February 14, 2024 22:34
AnywayFarus added a commit that referenced this pull request Feb 14, 2024
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