diff --git a/binaries/data/mods/public/maps/random/corsica.js b/binaries/data/mods/public/maps/random/corsica.js index cf9c4a0f7e..5b46112dc1 100644 --- a/binaries/data/mods/public/maps/random/corsica.js +++ b/binaries/data/mods/public/maps/random/corsica.js @@ -183,7 +183,7 @@ var nbCreeks = scaleByMapSize(6,15); var islandX = [SardiniaX,CorsicaX]; var islandZ = [SardiniaZ,CorsicaZ]; // first: the creeks -for (island = 0; island <= 1; island++) +for (var island = 0; island <= 1; island++) for (var i = 0; i <= nbCreeks; i++) { var radius = fractionToTiles( (Math.random()/17) + 0.49); @@ -206,7 +206,7 @@ for (island = 0; island <= 1; island++) } var nbBeaches = scaleByMapSize(2,5); -for (island = 0; island <= 1; island++) +for (var island = 0; island <= 1; island++) { for (var i = 0; i <= nbBeaches; i++) { diff --git a/binaries/data/mods/public/simulation/ai/qbot-wc/economy.js b/binaries/data/mods/public/simulation/ai/qbot-wc/economy.js index 815e4e99ba..be5f0df199 100644 --- a/binaries/data/mods/public/simulation/ai/qbot-wc/economy.js +++ b/binaries/data/mods/public/simulation/ai/qbot-wc/economy.js @@ -640,7 +640,7 @@ EconomyManager.prototype.updateResourceMaps = function(gameState, events) { } } else if (ent && ent.position() && ent.resourceDropsiteTypes) { var resources = ent.resourceDropsiteTypes(); - for (i in resources) { + for (var i in resources) { var resource = resources[i]; needUpdate[resource] = true; } diff --git a/binaries/data/mods/public/simulation/ai/qbot-wc/military.js b/binaries/data/mods/public/simulation/ai/qbot-wc/military.js index 6d17debf6c..8cc6108295 100755 --- a/binaries/data/mods/public/simulation/ai/qbot-wc/military.js +++ b/binaries/data/mods/public/simulation/ai/qbot-wc/military.js @@ -273,14 +273,14 @@ MilitaryAttackManager.prototype.ungarrisonAll = function(gameState) { }; MilitaryAttackManager.prototype.pausePlan = function(gameState, planName) { - for (attackType in this.upcomingAttacks) { + for (var attackType in this.upcomingAttacks) { for (var i in this.upcomingAttacks[attackType]) { var attack = this.upcomingAttacks[attackType][i]; if (attack.getName() == planName) attack.setPaused(gameState, true); } } - for (attackType in this.startedAttacks) { + for (var attackType in this.startedAttacks) { for (var i in this.startedAttacks[attackType]) { var attack = this.startedAttacks[attackType][i]; if (attack.getName() == planName) @@ -289,14 +289,14 @@ MilitaryAttackManager.prototype.pausePlan = function(gameState, planName) { } } MilitaryAttackManager.prototype.unpausePlan = function(gameState, planName) { - for (attackType in this.upcomingAttacks) { + for (var attackType in this.upcomingAttacks) { for (var i in this.upcomingAttacks[attackType]) { var attack = this.upcomingAttacks[attackType][i]; if (attack.getName() == planName) attack.setPaused(gameState, false); } } - for (attackType in this.startedAttacks) { + for (var attackType in this.startedAttacks) { for (var i in this.startedAttacks[attackType]) { var attack = this.startedAttacks[attackType][i]; if (attack.getName() == planName) @@ -305,13 +305,13 @@ MilitaryAttackManager.prototype.unpausePlan = function(gameState, planName) { } } MilitaryAttackManager.prototype.pauseAllPlans = function(gameState) { - for (attackType in this.upcomingAttacks) { + for (var attackType in this.upcomingAttacks) { for (var i in this.upcomingAttacks[attackType]) { var attack = this.upcomingAttacks[attackType][i]; attack.setPaused(gameState, true); } } - for (attackType in this.startedAttacks) { + for (var attackType in this.startedAttacks) { for (var i in this.startedAttacks[attackType]) { var attack = this.startedAttacks[attackType][i]; attack.setPaused(gameState, true); @@ -319,13 +319,13 @@ MilitaryAttackManager.prototype.pauseAllPlans = function(gameState) { } } MilitaryAttackManager.prototype.unpauseAllPlans = function(gameState) { - for (attackType in this.upcomingAttacks) { + for (var attackType in this.upcomingAttacks) { for (var i in this.upcomingAttacks[attackType]) { var attack = this.upcomingAttacks[attackType][i]; attack.setPaused(gameState, false); } } - for (attackType in this.startedAttacks) { + for (var attackType in this.startedAttacks) { for (var i in this.startedAttacks[attackType]) { var attack = this.startedAttacks[attackType][i]; attack.setPaused(gameState, false); @@ -351,7 +351,7 @@ MilitaryAttackManager.prototype.update = function(gameState, queues, events) { Engine.ProfileStart("Looping through attack plans"); // TODO: implement some form of check before starting a new attack plans. Sometimes it is not the priority. if (1) { - for (attackType in this.upcomingAttacks) { + for (var attackType in this.upcomingAttacks) { for (var i = 0;i < this.upcomingAttacks[attackType].length; ++i) { var attack = this.upcomingAttacks[attackType][i]; @@ -403,7 +403,7 @@ MilitaryAttackManager.prototype.update = function(gameState, queues, events) { } } } - for (attackType in this.startedAttacks) { + for (var attackType in this.startedAttacks) { for (var i = 0; i < this.startedAttacks[attackType].length; ++i) { var attack = this.startedAttacks[attackType][i]; // okay so then we'll update the attack.