add initialization of capturePoints in AIProxy + some cleanings

This was SVN commit r16584.
This commit is contained in:
mimo 2015-04-26 18:07:55 +00:00
parent 42c04cdad2
commit 8ff8667ed0
3 changed files with 5 additions and 11 deletions

View File

@ -98,7 +98,7 @@ m.PetraBot.prototype.OnUpdate = function(sharedScript)
for (var i in this.events)
{
if (i == "AIMetadata" || i == "RangeUpdate") // not used inside petra
if (i == "AIMetadata") // not used inside petra
continue;
if(this.savedEvents[i] !== undefined)
this.savedEvents[i] = this.savedEvents[i].concat(this.events[i]);

View File

@ -7,7 +7,6 @@ AIInterface.prototype.EventNames = [
"Create",
"Destroy",
"Attacked",
"RangeUpdate",
"ConstructionFinished",
"TrainingStarted",
"TrainingFinished",

View File

@ -302,6 +302,10 @@ AIProxy.prototype.GetFullRepresentation = function()
if (cmpTerritoryDecay)
ret.decaying = cmpTerritoryDecay.IsDecaying();
var cmpCapturable = Engine.QueryInterface(this.entity, IID_Capturable);
if (cmpCapturable)
ret.capturePoints = cmpCapturable.GetCapturePoints();
return ret;
};
@ -339,15 +343,6 @@ AIProxy.prototype.OnAttacked = function(msg)
this.cmpAIInterface.PushEvent("Attacked", msg);
};
/*
Deactivated for actually not really being practical for most uses.
AIProxy.prototype.OnRangeUpdate = function(msg)
{
msg.owner = this.owner;
this.cmpAIInterface.PushEvent("RangeUpdate", msg);
warn(uneval(msg));
};*/
AIProxy.prototype.OnConstructionFinished = function(msg)
{
this.cmpAIInterface.PushEvent("ConstructionFinished", msg);