Skip to content

Commit

Permalink
Correct use of VassalHideSide_<side> - these are booelean. Side hidde…
Browse files Browse the repository at this point in the history
…n when true.
  • Loading branch information
riverwanderer committed Sep 21, 2023
1 parent 59a0a59 commit 5a515e3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions vassal-app/src/main/java/VASSAL/build/module/PlayerRoster.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ protected void launch() {
newSide
);

// translated side names are lost in mixed language games when translateSide() used in Command parameters - this is a speculative fix
// translated side names are lost in mixed language games when translateSide() used in Command parameters. This is a speculative fix
final String translatedMySide = translateSide(mySide);
final String translatedNewSide = translateSide(newSide);

Expand Down Expand Up @@ -523,9 +523,8 @@ public Component getControls() {

// Scan VassalHideSide_<side> properties for module-controlled exclusions
for (int i = 0; i < availableSides.size(); i++) { // search of sides
String hideSide = (String) GameModule.getGameModule().getProperty("VassalHideSide" + availableSides.get(i));
if (!StringUtils.isEmpty(hideSide)) {
hideSide = translateSide(hideSide);
if (Boolean.valueOf((String) GameModule.getGameModule().getProperty("VassalHideSide_" + availableSides.get(i)))) {
String hideSide = translateSide(availableSides.get(i));
if (!alreadyTaken.contains(hideSide)) {
alreadyTaken.add(hideSide);
}
Expand Down Expand Up @@ -846,12 +845,10 @@ protected String promptForSide(String newSide) {
availableSides.clear();
availableSides.addAll(sides);

// Scan VassalHideSide_<side> properties for module-controlled exclusions
// sits within the loop in case of property changes between iterations (due to other player activity)
// Scan VassalHideSide_<side> properties for module-controlled exclusions (when true)
for (int i = 0; i < availableSides.size(); i++) { // search of sides
String hideSide = (String) g.getProperty("VassalHideSide" + availableSides.get(i));
if (!StringUtils.isEmpty(hideSide)) {
hideSide = translateSide(hideSide);
if (Boolean.valueOf((String) GameModule.getGameModule().getProperty("VassalHideSide_" + availableSides.get(i)))) {
String hideSide = translateSide(availableSides.get(i));
if (!alreadyTaken.contains(hideSide)) {
alreadyTaken.add(hideSide);
}
Expand Down

0 comments on commit 5a515e3

Please sign in to comment.