After playing long time regular (not AI) game, the algorithm starts to move my soldiers
kmorcinek opened this issue · comments
this.createBattleProvinces(this.provinceOwnership.getNeutralProvinces(), ProvinceOwner.Neutral);
const sourceProvince = this.getProvinceByName(provinceName); // null returned
// and later
const battleProvince = new BattleProvince(sourceProvince, provinceOwner);
throw new Error(`province is null`);
Maybe neutral
was throwing so far, and when the game is late, ->
there are no more Neutral
provinces ->
there is no error thrown ->
algorithm continue to calculate and it also freezes.
The fog of war
is the clue here.
- When I start a new game and all is visible (
for of war
to false) thenthrow new Error(province is null);
does NOT appear - When I start a new game and some provinces are NOT visible (
for of war
to true) then the error appears.
The probable solution is to switch OFF the "Run AI" checkbox and AI will not be running.
Maybe have it ON only on "testing" script?