Merge pull request #2041 from kevlahnota/newmaster2

fix ConcurrentModificationException and reloading WorldSave
This commit is contained in:
Anthony Calosa
2022-12-07 11:13:29 +08:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -179,7 +179,7 @@ public class AiAttackController {
List<Player> opps = Lists.newArrayList(ai.getOpponents()); List<Player> opps = Lists.newArrayList(ai.getOpponents());
if (forCombatDmg) { if (forCombatDmg) {
for (Player p : opps) { for (Player p : ai.getOpponents().threadSafeIterable()) {
if (p.isMonarch() && ai.canBecomeMonarch()) { if (p.isMonarch() && ai.canBecomeMonarch()) {
// just increase the odds for now instead of being fully predictable // just increase the odds for now instead of being fully predictable
// as it could lead to other too complex factors giving this reasoning negative impact // as it could lead to other too complex factors giving this reasoning negative impact

View File

@@ -79,6 +79,7 @@ public class WorldSave {
System.err.println("Generating New World"); System.err.println("Generating New World");
currentSave.world.generateNew(0); currentSave.world.generateNew(0);
} }
currentSave.pointOfInterestChanges.clear();
currentSave.onLoadList.emit(); currentSave.onLoadList.emit();