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

ModuleManager: patch in ModuleUPFMEvents during LAST pass instead of AFTER. #94

Conversation

keyspace
Copy link

@keyspace keyspace commented Apr 30, 2023

Closes #46 as fixed.
Closes #91 as duplicate (might have comments that are different issues?..).

Some mods modify existing nodes/modules in parts, others replace them; sometimes this happens in a chained manner.

Not all parts fail the same way, too, so OhScrap adds different *FailureModules across many files, often with rules on ordering, depending on which compatible mod is addressed.

In the touched ModuleManager patch, all parts that already have a *FailureModule also get a ModuleUPFMEvents.

Before this commit, RemoteTech antennas would get a RTAntennaFailureModule after the ModuleUPFMEvents patch has already run (and you don't get a second pass). This was because RemoteTech parts would only get their *FailureModule after getting a ModuleRTAntenna, different from antennas untouched by RT, which get a *FailureModule based on having a ModuleDataTransmitter, itself different from a custom ModuleRTDataTransmitter...

After this commit, parts having a *FailureModule are guaranteed to have a ModuleUPFMEvents. We do get a second pass!

This commit may also activate warranty and immediately expire it on all parts that were supposed to fail long ago, but were unable to communicate their intent to OhScrap.

More on ModuleManager patch ordering:

https://github.com/sarbian/ModuleManager/wiki/Patch-Ordering

… of `AFTER`.

Some mods modify existing nodes/modules in parts, others replace
them; sometimes this happens in a chained manner.

Not all parts fail the same way, too, so OhCrap adds different
`*FailureModule`s across many files, often with rules on ordering,
depending on which compatible mod is addressed.

In the touched ModuleManager patch, all parts that already have
a `*FailureModule` also get a `ModuleUPFMEvents`.

Before this commit, RemoteTech antennas would get a
`RTAntennaFailureModule` after the `ModuleUPFMEvents` patch has
already run (and you don't get a second pass). This was because
RemoteTech parts would only get their `*FailureModule` after
getting a `ModuleRTAntenna`, different from antennas untouched
by RT, which get a `*FailureModule` based on having a
`ModuleDataTransmitter`, itself different from a custom
`ModuleRTDataTransmitter`...

After this commit, parts having a `*FailureModule` are guaranteed
to have a `ModuleUPFMEvents`. We do get a second pass!

This commit may also activate warranty and immediately expire it
on all parts that were supposed to fail long ago, but were unable
to communicate their intent to OhScrap.

More on ModuleManager patch ordering:

https://github.com/sarbian/ModuleManager/wiki/Patch-Ordering
@keyspace
Copy link
Author

Testing - no display issues so far, no NREs...

image

@zer0Kerbal zer0Kerbal self-requested a review April 30, 2023 19:45
@zer0Kerbal zer0Kerbal added bug 🐛 An issue with the system. Something isn't working... KSC... we have an error code issue: compatibility/patch issue type labels Apr 30, 2023
@zer0Kerbal zer0Kerbal changed the base branch from master to 2.2.99.1-prerelease April 30, 2023 19:46
Copy link
Owner

@zer0Kerbal zer0Kerbal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely found! 🔎

@zer0Kerbal zer0Kerbal added the hacktoberfest-accepted flag for stating PR is accepted as appropriate for hacktoberfest label Apr 30, 2023
@zer0Kerbal zer0Kerbal merged commit 721c0fa into zer0Kerbal:2.2.99.1-prerelease Apr 30, 2023
@keyspace
Copy link
Author

keyspace commented Apr 30, 2023

No new bugs or new NREs on "live" save so far.

image

(Pic: One new booster in tandem with four old ones.)

IMO worth mentioning on next release that some parts that "never used to fail" now "perform as advertised".

@zer0Kerbal
Copy link
Owner

IMO worth mentioning on next release that some parts that "never used to fail" now "perform as advertised".

just plain deviously worded😂. I will mention that. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system. Something isn't working... KSC... we have an error code hacktoberfest-accepted flag for stating PR is accepted as appropriate for hacktoberfest issue: compatibility/patch issue type
Development

Successfully merging this pull request may close these issues.

[Bug 🐞]: NRE on game loading OhScrap + RemoteTech = NREs and "Antenna Safety Rating: -1"
2 participants