Resolve issues with 0c20afdfda - unitAI order cleanup and unitMotion MoveTo change

0c20afdfda had two issues:
- some of the unitAI code did not return true when switching states in
the "enter" phase
- missed a return false in unitMotion.cpp

This fixes the issue noticed by @bb.

Differential Revision: https://code.wildfiregames.com/D1947
This was SVN commit r22339.
This commit is contained in:
wraitii
2019-06-05 17:27:12 +00:00
parent f97213187e
commit dd67d0769e
2 changed files with 11 additions and 11 deletions
@@ -1506,7 +1506,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (!this.MoveTo(this.order.data))
{
this.FinishOrder();
return;
return true;
}
this.SelectAnimation("move");
},
@@ -1526,7 +1526,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (!this.MoveTo(this.order.data))
{
this.FinishOrder();
return;
return true;
}
// Show weapons rather than carried resources.
this.SetAnimationVariant("combat");
@@ -1558,7 +1558,7 @@ UnitAI.prototype.UnitFsmSpec = {
!this.MoveTo(this.order.data))
{
this.FinishOrder();
return;
return true;
}
if (!this.patrolStartPosOrder)
@@ -1604,7 +1604,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (!this.MoveToTargetRangeExplicit(this.isGuardOf, 0, this.guardRange))
{
this.FinishOrder();
return;
return true;
}
// Show weapons rather than carried resources.
@@ -1714,7 +1714,7 @@ UnitAI.prototype.UnitFsmSpec = {
!cmpUnitMotion || !cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
{
this.FinishOrder();
return;
return true;
}
this.PlaySound("panic");
@@ -1759,7 +1759,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (!this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
{
this.FinishOrder();
return;
return true;
}
// Show weapons rather than carried resources.
@@ -1841,7 +1841,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (this.MoveToTargetAttackRange(target, this.order.data.attackType))
{
this.SetNextState("COMBAT.CHASING");
return;
return true;
}
}
}
@@ -2017,7 +2017,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (!this.MoveTo(this.order.data))
{
this.FinishOrder();
return;
return true;
}
// Show weapons rather than carried resources.
@@ -2203,7 +2203,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (!this.MoveTo(this.order.data))
{
this.FinishOrder();
return;
return true;
}
this.SelectAnimation("move");
},
@@ -2658,7 +2658,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (!this.MoveToMarket(this.order.data.target))
{
this.FinishOrder();
return;
return true;
}
this.SelectAnimation("move");
},
@@ -1647,7 +1647,7 @@ bool CCmpUnitMotion::MoveToTargetRange(entity_id_t target, entity_pos_t minRange
// We're already in range - no need to move anywhere
if (m_FacePointAfterMove)
FaceTowardsPointFromPos(pos, goal.x, goal.z);
return false;
return true;
}
entity_pos_t goalDistance = maxRange - Pathfinding::GOAL_DELTA;