Skip to content

Commit

Permalink
Merge pull request MegaMek#5846 from SJuliez/turn-lookup
Browse files Browse the repository at this point in the history
Index guard for turn lookup to prevent error messages
  • Loading branch information
Sleet01 authored Aug 4, 2024
2 parents 887fff7 + d336f19 commit 77dd685
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ public List<Entity> getValidTargets(Entity entity) {
* turns to play
*/
public @Nullable GameTurn getTurnForPlayer(int pn) {
synchronized (turnVector) {
if ((turnIndex >= 0) && (turnIndex < turnVector.size())) {
for (int i = turnIndex; i < turnVector.size(); i++) {
GameTurn gt = turnVector.get(i);
if (gt.isValid(pn, this)) {
Expand Down

0 comments on commit 77dd685

Please sign in to comment.