* Fixed AI game freeze on choose new targets (#5023);

This commit is contained in:
Oleg Agafonov 2019-04-19 18:57:36 +04:00
parent 3fa97d47c6
commit 03795f1aae

View file

@ -188,6 +188,11 @@ public abstract class StackObjImpl implements StackObject {
newTarget.clearChosen();
}
}
// workaround to stop infinite AI choose (remove after chooseTarget can be called with extra filter to disable some ids)
if (iteration > 10) {
break;
}
}
while (targetController.canRespond() && (targetId.equals(newTarget.getFirstTarget()) || newTarget.getTargets().size() != 1));
// choose a new target