Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging nation disbanding ticket. #7143

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public static void removeOutOfRangeTowns(Nation nation) {
}

public static boolean isTownTooFarFromNation(Town town, Town newCapital, List<Town> towns) {
if (closeEnoughToCapital(town, newCapital) || closeEnoughToOtherNationTowns(town, newCapital, towns))
if (closeEnoughToCapital(town, newCapital) ||
TownySettings.getNationProximityToOtherNationTowns() > 0 && closeEnoughToOtherNationTowns(town, newCapital, towns))
return false;
return true;
}
Expand All @@ -109,10 +110,10 @@ private static boolean closeEnoughToCapital(Town town, Town newCapital) {
private static boolean closeEnoughToOtherNationTowns(Town town, Town newCapital, List<Town> towns) {
double maxDistanceFromOtherTowns = TownySettings.getNationProximityToOtherNationTowns();
double maxDistanceFromTheCapital = TownySettings.getNationProximityAbsoluteMaximum();

// Other towns in the nation are not giving any proximity buff, only the capital is counted.
if (maxDistanceFromOtherTowns <= 0)
return false;
//
// // Other towns in the nation are not giving any proximity buff, only the capital is counted.
// if (maxDistanceFromOtherTowns <= 0)
// return false;

// The town is too far from the nation's absolute cap on proximity from the capital homeblock.
if (maxDistanceFromTheCapital > 0 && !closeEnoughToTown(town, newCapital, maxDistanceFromTheCapital))
Expand Down