forked from 0ad/0ad
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:
parent
d238128960
commit
ba071f8b4e
@ -52,7 +52,9 @@ RallyPoint.prototype.GetPositions = function()
|
|||||||
if (this.pos[i].x == targetPosition.x && this.pos[i].z == targetPosition.y)
|
if (this.pos[i].x == targetPosition.x && this.pos[i].z == targetPosition.y)
|
||||||
continue;
|
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);
|
var cmpRallyPointRenderer = Engine.QueryInterface(this.entity, IID_RallyPointRenderer);
|
||||||
if (cmpRallyPointRenderer)
|
if (cmpRallyPointRenderer)
|
||||||
cmpRallyPointRenderer.UpdatePosition(i, targetPosition);
|
cmpRallyPointRenderer.UpdatePosition(i, targetPosition);
|
||||||
|
Loading…
Reference in New Issue
Block a user