forked from 0ad/0ad
Rename common-api-v3 to common-api.
Fix warnings with the new AI. Fix an error with the per-player gatherer counts. This was SVN commit r14559.
This commit is contained in:
parent
87250a79c9
commit
bd22432fe8
@ -8,6 +8,6 @@ This bot has been made default as of Alpha 13. It features some technological su
|
||||
|
||||
Please report any error to the wildfire games forum ( http://www.wildfiregames.com/forum/index.php?act=idx ), and thanks for playing!
|
||||
|
||||
Requires common-api-v3.
|
||||
Requires common-api;
|
||||
|
||||
(note: no saved game support as of yet).
|
||||
|
@ -1 +1 @@
|
||||
Engine.IncludeModule("common-api-v3");
|
||||
Engine.IncludeModule("common-api");
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
var AEGIS = (function() {
|
||||
var m = {};
|
||||
|
||||
|
@ -299,7 +299,7 @@ m.Army.prototype.removeDefender = function (gameState, defenderID, defenderObj)
|
||||
delete this.assignedTo[defenderID];
|
||||
|
||||
if (defenderObj !== undefined || ent.owner() !== PlayerID)
|
||||
return; // assume this means dead.
|
||||
return false; // assume this means dead.
|
||||
|
||||
ent.setMetadata(PlayerID, "DefManagerArmy", undefined);
|
||||
|
||||
@ -324,7 +324,7 @@ m.Army.prototype.assignDefender = function (gameState, entID)
|
||||
var ent = gameState.getEntityById(entID);
|
||||
|
||||
if (!ent)
|
||||
return;
|
||||
return false;
|
||||
|
||||
// TODO: improve the logic in there.
|
||||
var maxVal = 1000000;
|
||||
@ -349,7 +349,7 @@ m.Army.prototype.assignDefender = function (gameState, entID)
|
||||
}
|
||||
}
|
||||
if (maxEnt === -1)
|
||||
return;
|
||||
return false;
|
||||
|
||||
// let's attack id
|
||||
this.assignedAgainst[maxEnt].push(entID);
|
||||
|
@ -1 +1 @@
|
||||
Engine.IncludeModule("common-api-v3");
|
||||
Engine.IncludeModule("common-api");
|
@ -142,7 +142,7 @@ ResourceSupply.prototype.RemoveGatherer = function(gathererID, player)
|
||||
// this can happen if the unit is dead
|
||||
if (player === undefined || player === -1)
|
||||
{
|
||||
for (var i = 1; i <= 8; ++i)
|
||||
for (var i = 0; i <= 7; ++i)
|
||||
{
|
||||
var index = this.gatherers[i].indexOf(gathererID);
|
||||
if (index !== -1)
|
||||
|
@ -356,7 +356,7 @@ public:
|
||||
// reset the value so it can be used to determine if we actually initialized it.
|
||||
m_HasSharedComponent = false;
|
||||
|
||||
if (LoadScripts(L"common-api-v3"))
|
||||
if (LoadScripts(L"common-api"))
|
||||
m_HasSharedComponent = true;
|
||||
else
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user