1
0
forked from 0ad/0ad

Rotate entities to the right angle when forming a formation

This was SVN commit r14909.
This commit is contained in:
sanderd17 2014-04-09 11:15:00 +00:00
parent 4ddf1ac4dc
commit 1f63325ede

View File

@ -250,6 +250,12 @@ Formation.prototype.SetInPosition = function(ent)
if (this.inPosition.indexOf(ent) != -1)
return;
// Rotate the entity to the right angle
var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
var cmpEntPosition = Engine.QueryInterface(ent, IID_Position);
if (cmpEntPosition && cmpEntPosition.IsInWorld() && cmpPosition && cmpPosition.IsInWorld)
cmpEntPosition.TurnTo(cmpPosition.GetRotation().y);
this.inPosition.push(ent);
};