forked from 0ad/0ad
remove distance sorting for formation place assignment, as it made the center of the formation run + remove debug warning in AI code
This was SVN commit r14292.
This commit is contained in:
parent
03d9db0bb7
commit
7b82fba8d0
@ -297,7 +297,6 @@ SharedScript.prototype.ApplyEntitiesDelta = function(state)
|
||||
// Switch the metadata
|
||||
for (var i in this._players)
|
||||
{
|
||||
warn (uneval(this._entityMetadata[this._players[i]][evt.msg.entity]));
|
||||
this._entityMetadata[this._players[i]][evt.msg.newentity] = this._entityMetadata[this._players[i]][evt.msg.entity];
|
||||
this._entityMetadata[this._players[i]][evt.msg.entity] = {};
|
||||
}
|
||||
|
@ -692,18 +692,6 @@ Formation.prototype.ComputeFormationOffsets = function(active, positions, column
|
||||
{
|
||||
var usedOffsets = offsets.splice(0,t.length);
|
||||
var usedRealPositions = realPositions.splice(0, t.length);
|
||||
// sort t so the entities far away can pick
|
||||
// their position first. This reduces the maximum distance run,
|
||||
// and thus the time to form a position
|
||||
t.sort(function(entPos1, entPos2)
|
||||
{
|
||||
var dx1 = entPos1.pos.x - formationPos.x;
|
||||
var dz1 = entPos1.pos.z - formationPos.z;
|
||||
var dx2 = entPos2.pos.x - formationPos.x;
|
||||
var dz2 = entPos2.pos.z - formationPos.z;
|
||||
return dx1 * dx1 + dz1 *dz1 < dx2 * dx2 + dz2 * dz2;
|
||||
});
|
||||
|
||||
for each (var entPos in t)
|
||||
{
|
||||
var closestOffsetId = this.TakeClosestOffset(entPos, usedRealPositions);
|
||||
|
Loading…
Reference in New Issue
Block a user