Skip to content

Commit

Permalink
Fix bugs that caused Ferians to freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
gmoromisato committed Jan 8, 2019
1 parent 2b68c0b commit a73df3f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions TSE/CFerianShipAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,12 @@ void CFerianShipAI::BehaviorStart (void)
case IShipController::orderNone:
{
if (m_pShip->GetDockedObj() == NULL)
AddOrder(IShipController::orderGate, NULL, IShipController::SData());
{
FireOnOrdersCompleted();

if (GetCurrentOrder() == IShipController::orderNone)
AddOrder(IShipController::orderGate, NULL, IShipController::SData());
}
break;
}

Expand Down Expand Up @@ -539,6 +544,10 @@ void CFerianShipAI::OnObjDestroyedNotify (const SDestroyCtx &Ctx)
{
if (Ctx.pObj == GetCurrentOrderTarget())
{
// Stop mining

CancelCurrentOrder();

// Avenge the base

CSpaceObject *pTarget;
Expand All @@ -548,12 +557,6 @@ void CFerianShipAI::OnObjDestroyedNotify (const SDestroyCtx &Ctx)
AddOrder(orderDestroyTarget, pTarget, SData());
else if (m_State == stateAttackingThreat)
AddOrder(orderDestroyTarget, m_pTarget, SData());
else
AddOrder(orderAttackNearestEnemy, NULL, SData());

// Stop mining

CancelCurrentOrder();
}
break;
}
Expand Down

0 comments on commit a73df3f

Please sign in to comment.