mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-12 06:55:48 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user