Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kuronekochomusuke committed Dec 4, 2023
1 parent c913302 commit 6df8b2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion megamek/src/megamek/client/ui/swing/Ruler.java
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private LosEffects.AttackInfo buildAttackInfo(Coords c1, Coords c2, int h1,
ai.targetHeight = h2;
ai.attackerIsMech = attackerIsMech;
ai.targetIsMech = targetIsMech;
ai.attackAbsHeight =game.getBoard().getHex(c1).floor() + h1;
ai.attackAbsHeight = game.getBoard().getHex(c1).floor() + h1;
ai.targetAbsHeight = game.getBoard().getHex(c2).floor() + h2;
return ai;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ protected void finalizeInitialization() throws Exception {
adaptToGUIScale();
super.finalizeInitialization();
}

@Override
protected void okAction() {
apply();
Expand Down
21 changes: 7 additions & 14 deletions megamek/src/megamek/common/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12899,8 +12899,7 @@ public int getStartingPos(boolean inheritFromOwner) {
final GameOptions gOpts = getGame().getOptions();
if (!getOwner().isBot() && gOpts.booleanOption(OptionsConstants.BASE_SET_PLAYER_DEPLOYMENT_TO_PLAYER0)) {
return game.getPlayer(0).getStartingPos();
}
else {
} else {
return getOwner().getStartingPos();
}
}
Expand Down Expand Up @@ -15303,8 +15302,7 @@ public int getStartingOffset(boolean inheritFromOwner) {
final GameOptions gOpts = getGame().getOptions();
if (!getOwner().isBot() && gOpts.booleanOption(OptionsConstants.BASE_SET_PLAYER_DEPLOYMENT_TO_PLAYER0)) {
return game.getPlayer(0).getStartOffset();
}
else {
} else {
return getOwner().getStartOffset();
}
}
Expand All @@ -15327,8 +15325,7 @@ public int getStartingWidth(boolean inheritFromOwner) {
final GameOptions gOpts = getGame().getOptions();
if (!getOwner().isBot() && gOpts.booleanOption(OptionsConstants.BASE_SET_PLAYER_DEPLOYMENT_TO_PLAYER0)) {
return game.getPlayer(0).getStartWidth();
}
else {
} else {
return getOwner().getStartWidth();
}
}
Expand All @@ -15351,8 +15348,7 @@ public int getStartingAnyNWx(boolean inheritFromOwner) {
final GameOptions gOpts = getGame().getOptions();
if (!getOwner().isBot() && gOpts.booleanOption(OptionsConstants.BASE_SET_PLAYER_DEPLOYMENT_TO_PLAYER0)) {
return game.getPlayer(0).getStartingAnyNWx();
}
else {
} else {
return getOwner().getStartingAnyNWx();
}
}
Expand All @@ -15375,8 +15371,7 @@ public int getStartingAnyNWy(boolean inheritFromOwner) {
final GameOptions gOpts = getGame().getOptions();
if (!getOwner().isBot() && gOpts.booleanOption(OptionsConstants.BASE_SET_PLAYER_DEPLOYMENT_TO_PLAYER0)) {
return game.getPlayer(0).getStartingAnyNWy();
}
else {
} else {
return getOwner().getStartingAnyNWy();
}
}
Expand All @@ -15399,8 +15394,7 @@ public int getStartingAnySEx(boolean inheritFromOwner) {
final GameOptions gOpts = getGame().getOptions();
if (!getOwner().isBot() && gOpts.booleanOption(OptionsConstants.BASE_SET_PLAYER_DEPLOYMENT_TO_PLAYER0)) {
return game.getPlayer(0).getStartingAnySEx();
}
else {
} else {
return getOwner().getStartingAnySEx();
}
}
Expand All @@ -15423,8 +15417,7 @@ public int getStartingAnySEy(boolean inheritFromOwner) {
final GameOptions gOpts = getGame().getOptions();
if (!getOwner().isBot() && gOpts.booleanOption(OptionsConstants.BASE_SET_PLAYER_DEPLOYMENT_TO_PLAYER0)) {
return game.getPlayer(0).getStartingAnySEy();
}
else {
} else {
return getOwner().getStartingAnySEy();
}
}
Expand Down

0 comments on commit 6df8b2f

Please sign in to comment.