Skip to content

Commit

Permalink
fix(mechanics): Escorts stop following orders after the flagship dies (
Browse files Browse the repository at this point in the history
  • Loading branch information
petervdmeer authored Jun 23, 2024
1 parent a9fa3f1 commit c887900
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/AI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1550,9 +1550,12 @@ bool AI::FollowOrders(Ship &ship, Command &command) const

int type = it->second.type;

// Ships without an (alive) parent don't follow orders.
shared_ptr<Ship> parent = ship.GetParent();
if(!parent)
return false;
// If your parent is jumping or absent, that overrides your orders unless
// your orders are to hold position.
shared_ptr<Ship> parent = ship.GetParent();
if(parent && type != Orders::HOLD_POSITION && type != Orders::HOLD_ACTIVE && type != Orders::MOVE_TO)
{
if(parent->GetSystem() != ship.GetSystem())
Expand Down

0 comments on commit c887900

Please sign in to comment.