Reduce number of rallypoint recalculations when a target has moved before, but doesn't move now.

This was SVN commit r18256.
This commit is contained in:
sanderd17 2016-05-29 12:15:24 +00:00
parent d238128960
commit ba071f8b4e

View File

@ -52,7 +52,9 @@ RallyPoint.prototype.GetPositions = function()
if (this.pos[i].x == targetPosition.x && this.pos[i].z == targetPosition.y)
continue;
ret[i] = {"x": targetPosition.x, "z": targetPosition.y};
// update the positions for ret and this.pos (referencing the same object)
this.pos[i].x = targetPosition.x;
this.pos[i].z = targetPosition.y;
var cmpRallyPointRenderer = Engine.QueryInterface(this.entity, IID_RallyPointRenderer);
if (cmpRallyPointRenderer)
cmpRallyPointRenderer.UpdatePosition(i, targetPosition);