Remove redundant code for animal fleeing, and don't omit expected arguments.

This was SVN commit r9601.
This commit is contained in:
Ykkrosh 2011-06-09 16:41:55 +00:00
parent 28d952404e
commit 902b33a181

View File

@ -1088,15 +1088,14 @@ var UnitFsmSpec = {
if (this.template.NaturalBehaviour == "skittish" || if (this.template.NaturalBehaviour == "skittish" ||
this.template.NaturalBehaviour == "passive") this.template.NaturalBehaviour == "passive")
{ {
this.MoveToTargetRangeExplicit(msg.data.attacker, +this.template.FleeDistance, +this.template.FleeDistance); this.Flee(msg.data.attacker, false);
this.Flee(msg.data.attacker);
} }
else if (this.template.NaturalBehaviour == "violent" || else if (this.template.NaturalBehaviour == "violent" ||
this.template.NaturalBehaviour == "aggressive" || this.template.NaturalBehaviour == "aggressive" ||
this.template.NaturalBehaviour == "defensive") this.template.NaturalBehaviour == "defensive")
{ {
if (this.CanAttack(msg.data.attacker)) if (this.CanAttack(msg.data.attacker))
this.ReplaceOrder("Attack", { "target": msg.data.attacker }); this.Attack(msg.data.attacker, false);
} }
}, },
@ -1158,8 +1157,7 @@ var UnitFsmSpec = {
{ {
if (msg.data.added.length > 0) if (msg.data.added.length > 0)
{ {
this.MoveToTargetRangeExplicit(msg.data.added[0], +this.template.FleeDistance, +this.template.FleeDistance); this.Flee(msg.data.added[0], false);
this.Flee(msg.data.added[0]);
return; return;
} }
} }
@ -1203,8 +1201,7 @@ var UnitFsmSpec = {
{ {
if (msg.data.added.length > 0) if (msg.data.added.length > 0)
{ {
this.MoveToTargetRangeExplicit(msg.data.added[0], +this.template.FleeDistance, +this.template.FleeDistance); this.Flee(msg.data.added[0], false);
this.Flee(msg.data.added[0]);
return; return;
} }
} }