Skip to content

Commit

Permalink
- Refactor townAdd method to better handle adding and revoking
Browse files Browse the repository at this point in the history
invites.
  - Fix not being able to add towns to nations when the
residents-per-nation setting is 0.
  • Loading branch information
LlmDl committed Jan 16, 2024
1 parent ccfca86 commit 5916aab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Towny/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<artifactId>towny</artifactId>
<packaging>jar</packaging>
<version>0.100.1.2</version>
<version>0.100.1.3</version>

<licenses>
<license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static boolean canAddTownsResidentCount(Nation nation, int additionalResi
if (hasReachedMaximumResidents(nation))
return false;
int maxResidentPerNation = TownySettings.getMaxResidentsPerNation();
return maxResidentPerNation > 0 && (nation.getResidents().size() + additionalResidents) >= maxResidentPerNation;
return maxResidentPerNation == 0 || (nation.getResidents().size() + additionalResidents) < maxResidentPerNation;
}

public static boolean hasReachedMaximumTowns(Nation nation) {
Expand Down
5 changes: 4 additions & 1 deletion Towny/src/main/resources/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9455,4 +9455,7 @@ v0.92.0.11:
- Add NationUtil.
- Move max allies test into NationUtil.
- Add more nation-joining tests to the NationUtil.
- Refactor nation adding towns in the NationCommand class.
- Refactor nation adding towns in the NationCommand class.
0.100.1.3:
- Refactor townAdd method to better handle adding and revoking invites.
- Fix not being able to add towns to nations when the residents-per-nation setting is 0.

0 comments on commit 5916aab

Please sign in to comment.