add rally points for the AIs

This was SVN commit r15338.
This commit is contained in:
mimo 2014-06-12 18:41:13 +00:00
parent e3f3051b2a
commit 350d4a6b7e

View File

@ -818,6 +818,17 @@ m.Entity = m.Class({
return this;
},
setRallyPoint: function(target, command) {
var data = {"command": command, "target": target.id()};
Engine.PostCommand(PlayerID, {"type": "set-rallypoint", "entities": [this.id()], "x": target.position()[0], "z": target.position()[1], "data": data});
return this;
},
unsetRallyPoint: function() {
Engine.PostCommand(PlayerID, {"type": "unset-rallypoint", "entities": [this.id()]});
return this;
},
train: function(type, count, metadata)
{
var trainable = this.trainableEntities();