Skip to content

Commit

Permalink
Add back missing ArmsFlipped gating, previously checked into wrong br…
Browse files Browse the repository at this point in the history
…anch
  • Loading branch information
Sleet01 committed Jan 22, 2024
1 parent 4f2ecd9 commit 4c04b4a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion megamek/src/megamek/client/ui/swing/FiringDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ public void selectEntity(int en) {
setTwistEnabled(!ce().getAlreadyTwisted() && ce().canChangeSecondaryFacing() && ce().getCrew().isActive());

setFindClubEnabled(FindClubAction.canMechFindClub(clientgui.getClient().getGame(), en));
setFlipArmsEnabled(ce().canFlipArms());
setFlipArmsEnabled(!ce().getAlreadyTwisted() && ce().canFlipArms());
updateSearchlight();
updateClearTurret();
updateClearWeaponJam();
Expand Down Expand Up @@ -2351,6 +2351,8 @@ void updateFlipArms(boolean armsFlipped) {
return;
} else if (armsFlipped == ce().getArmsFlipped()) {
return;
} else if (ce().getAlreadyTwisted()) {
return;
}

twisting = false;
Expand Down
11 changes: 11 additions & 0 deletions megamek/src/megamek/common/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,17 @@ public void setFindingClub(boolean findingClub) {
* Set whether or not the mech's arms are flipped to the rear
*/
public void setArmsFlipped(boolean armsFlipped) {
GamePhase phase = getGame().getPhase();
if (phase != null) {
// If we already twisted/flipped in an earlier phase, return out
if (getAlreadyTwisted()) {
return;
}
if (phase.isOffboard() || phase.isFiring()) {
// Only Offboard and Firing phases could conceivably have later phases with twisting
setAlreadyTwisted(true);
}
}
setArmsFlipped(armsFlipped, true);
}

Expand Down

0 comments on commit 4c04b4a

Please sign in to comment.