1
0
forked from 0ad/0ad

Check that we still have build orders for our attack plan. Temporarily fixes #2082 for A14.

This was SVN commit r13761.
This commit is contained in:
wraitii 2013-08-25 08:20:40 +00:00
parent 589e8d2ae8
commit 52f947fd77

View File

@ -473,6 +473,13 @@ CityAttack.prototype.updatePreparation = function(gameState, militaryManager,eve
} else if (!this.mustStart(gameState)) {
// We still have time left to recruit units and do stuffs.
// TODO: check why this can happen instead of resorting to this "hack".
if (this.buildOrder.length === 0 || this.buildOrder[0] === undefined) {
debug ("Ending plan: no build orders");
return 0; // will abort the plan, should return something else
}
// let's sort by training advancement, ie 'current size / target size'
// count the number of queued units too.
// substract priority.