forked from 0ad/0ad
add initialization of capturePoints in AIProxy + some cleanings
This was SVN commit r16584.
This commit is contained in:
parent
42c04cdad2
commit
8ff8667ed0
@ -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]);
|
||||
|
@ -7,7 +7,6 @@ AIInterface.prototype.EventNames = [
|
||||
"Create",
|
||||
"Destroy",
|
||||
"Attacked",
|
||||
"RangeUpdate",
|
||||
"ConstructionFinished",
|
||||
"TrainingStarted",
|
||||
"TrainingFinished",
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user