This finishes the militia recalling section - militiamen are now recalled every 30 seconds or so.

This was SVN commit r10311.
This commit is contained in:
James Baillie 2011-09-24 16:37:31 +00:00
parent b9fc207437
commit bb3b52fb82

View File

@ -223,7 +223,7 @@ var MilitaryAttackManager = Class({
});
},
combatcheck_militia: function(gameState, planGroups, assaultgroup)
combatcheckMilitia: function(gameState, planGroups, assaultgroup)
{
var regroupneeded = gameState.getOwnEntitiesWithRole(assaultgroup);
regroupneeded.forEach(function(troop) {
@ -240,7 +240,7 @@ var MilitaryAttackManager = Class({
}
});
// Check that some of our own buildings are nearby
var ownbuildings = gameState.getOwnEntities.filter(function(ent) {
var ownbuildings = gameState.getOwnEntities().filter(function(ent) {
var foeposition = ent.position();
if (foeposition){
var dist = VectorDistance(foeposition, currentPosition);
@ -701,7 +701,7 @@ var MilitaryAttackManager = Class({
this.combatcheck(gameState, planGroups, "attack_3p1");
this.combatcheck(gameState, planGroups, "attack_3p2");
this.combatcheck(gameState, planGroups, "attack_3p3");
this.combatcheck(gameState, planGroups, "militia");
this.combatcheckMilitia(gameState, planGroups, "militia");
//this.trainDefenderSquad(gameState, planGroups);
this.trainAttackSquad(gameState, planGroups);
this.regroup(gameState, planGroups);