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

Fix: Bugs not working for soil patches with bugs don't despawn cheat #3457

Merged

Conversation

Archez
Copy link
Contributor

@Archez Archez commented Nov 28, 2023

The "Bugs Don't despawn" cheat was interferring with bugs ability to dig into the soil patches as the check was preventing the "dig" action func from ever running. The dig action func is responsible for informing the soil patch that the bugs are done digging and to then spawn the gold skulltula.

This PR resolves that by moving the logic to the init func and checking to see if a soil patch is linked to the bugs. If there is no soil patch, then we remove the flag that marks the bug as a "short lived" bug, effectively making it never dig. The other important part is to not increment the "bugs dropped count" value. Normally if there is 4 or more bugs "dropped", then new bugs dropped instantly dig in place. For a soil patch to spawn the GS, the bugs need to dig directly in the center. By not incrementing the dropped count for the bugs, the new ones will correctly path find to the soil patch and dig properly.

Build Artifacts

// For bugs that aren't linked to a soil patch, we remove the "short lived" flag to prevent them from despawning
// And exit early to not increment the "bugs dropped count"
if (CVarGetInteger("gNoBugsDespawn", 0) && this->soilActor == NULL) {
this->unk_314 &= ~4;
Copy link
Contributor

Choose a reason for hiding this comment

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

would love to see this not be magic numbers but considering the unk i figure that can come in with a docs pull at some point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah this entire actor file is wonderfully doc'ed in decomp upstream 😉 (I referenced decomp for these changes)
Updating against decomp should be a nice freebie for the develop branch later.
(I have a short list of a few files that I'd like to update once we do another macready->dev)

@aMannus aMannus merged commit 33fe877 into HarbourMasters:develop-macready Nov 29, 2023
8 checks passed
@Archez Archez deleted the fix-bugs-dont-despawn branch November 29, 2023 05:11
A-Green-Spoon pushed a commit to A-Green-Spoon/Shipwright that referenced this pull request Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants