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

Index guard for turn lookup to prevent error messages #5846

Merged
merged 1 commit into from
Aug 4, 2024

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Aug 3, 2024

This adds an index guard to Game.getTurnForPlayer() to prevent frequent log error messages. getTurnForPlayer() is called from Client.isMyTurn() when the phase is simultaneous which is the case for the PRE_* phases (activating hidden units). A similar guard is already present for Game.getTurn() which is used for non-simultaneous phases.

Removed the synchronized as MM is not multithreaded, even when simultaneous turns are used (and please let's keep it that way)

Copy link

codecov bot commented Aug 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.99%. Comparing base (6a651eb) to head (d336f19).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5846   +/-   ##
=========================================
  Coverage     28.99%   28.99%           
  Complexity    13930    13930           
=========================================
  Files          2512     2512           
  Lines        267279   267278    -1     
  Branches      47833    47833           
=========================================
  Hits          77509    77509           
+ Misses       185820   185819    -1     
  Partials       3950     3950           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sleet01 Sleet01 merged commit 77dd685 into MegaMek:master Aug 4, 2024
5 checks passed
@SJuliez SJuliez deleted the turn-lookup branch October 15, 2024 19:32
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.

3 participants