forked from 0ad/0ad
transfer the entities angles to the AIs
This was SVN commit r18231.
This commit is contained in:
parent
07007f1963
commit
9c67cd6743
@ -614,6 +614,7 @@ m.Entity = m.Class({
|
||||
},
|
||||
|
||||
position: function() { return this._entity.position; },
|
||||
angle: function() { return this._entity.angle; },
|
||||
|
||||
isIdle: function() {
|
||||
if (typeof this._entity.idle === "undefined")
|
||||
|
@ -88,9 +88,15 @@ AIProxy.prototype.OnPositionChanged = function(msg)
|
||||
return;
|
||||
|
||||
if (msg.inWorld)
|
||||
{
|
||||
this.changes.position = [msg.x, msg.z];
|
||||
this.changes.angle = msg.a;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.changes.position = undefined;
|
||||
this.changes.angle = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
AIProxy.prototype.OnHealthChanged = function(msg)
|
||||
@ -215,12 +221,14 @@ AIProxy.prototype.GetFullRepresentation = function()
|
||||
|
||||
if (cmpPosition.IsInWorld())
|
||||
{
|
||||
var pos = cmpPosition.GetPosition2D();
|
||||
let pos = cmpPosition.GetPosition2D();
|
||||
ret.position = [pos.x, pos.y];
|
||||
ret.angle = cmpPosition.GetRotation().y;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.position = undefined;
|
||||
ret.angle = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user