fix querying unitAI of non-existing members

This was SVN commit r14312.
This commit is contained in:
sanderd17 2013-12-08 19:57:34 +00:00
parent 966f7c7145
commit 208200db28

View File

@ -118,6 +118,7 @@ Formation.prototype.SetMembers = function(ents)
*/
Formation.prototype.RemoveMembers = function(ents)
{
this.offsets = undefined;
this.members = this.members.filter(function(e) { return ents.indexOf(e) == -1; });
this.inPosition = this.inPosition.filter(function(e) { return ents.indexOf(e) == -1; });
@ -150,7 +151,6 @@ Formation.prototype.RemoveMembers = function(ents)
if (!this.rearrange)
return;
this.offsets = undefined;
this.ComputeMotionParameters();
// Rearrange the remaining members