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

Candidate fix for #5417 NPE Freeze bot moves invalid or nonsense. #5430

Merged
merged 2 commits into from
Apr 28, 2024

Conversation

HoneySkull
Copy link
Collaborator

@HoneySkull HoneySkull commented Apr 28, 2024

Fixes #5417

Moved processGameEvent() back into setPhase() where it was. setPhase() gets called from places currently that receivePhase() doesn't get called from. It looks like this was pulled out as a refactor but has un-intended side effects for the bots processing.

image

Before making this tweak, I was able to easily reproduce the NPE by running a bot vs bot as described in #5417. After this change, the bot games end naturally after 15 to 25 rounds. Before this tweak, the same bot games would either end in a NPE or infinite mindless bot moves that would go into over 100 rounds.

@@ -674,11 +674,11 @@ public GamePhase getPhase() {
public void receivePhase(GamePhase phase) {
final GamePhase oldPhase = this.phase;
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be remove since oldPhase is no longer used

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes that should be removed. - I saw that after I committed it.

@SJuliez SJuliez merged commit 5bc5647 into MegaMek:master Apr 28, 2024
4 checks passed
@HoneySkull HoneySkull deleted the Fix_5417_NPE_Freeze branch July 12, 2024 01:04
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.

49.20 MM Standalone Build - NPE Freeze. Kicking and Replacing Bots does not restart action.
3 participants