Skip to content

Commit

Permalink
Fix the horrid VTOL Strike/CB rearming behavior
Browse files Browse the repository at this point in the history
While using a single VTOL is fine on these sensors, problems arise when there are multiple.

If multiple VTOLs are assigned to the VTOL sensors they would only attack if full as a group if the target didn't die. Causing 1 attack per VTOL of the whole group on the target.
  • Loading branch information
KJeff01 committed Oct 31, 2023
1 parent bbfc6da commit 4b2fc85
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,11 @@ void orderUpdateDroid(DROID *psDroid)
bAttack = false;
if (isVtolDroid(psDroid))
{
if (!vtolEmpty(psDroid) &&
if (psDroid->action == DACTION_WAITDURINGREARM)
{
// Calm down. It's not that serious.
}
else if (!vtolEmpty(psDroid) &&
((psDroid->action == DACTION_MOVETOREARM) ||
(psDroid->action == DACTION_WAITFORREARM)) &&
(psDroid->sMove.Status != MOVEINACTIVE))
Expand All @@ -1055,7 +1059,7 @@ void orderUpdateDroid(DROID *psDroid)
// get them to attack the new target rather than returning to rearm
bAttack = true;
}
else if (allVtolsRearmed(psDroid))
else if (!vtolEmpty(psDroid))
{
bAttack = true;
}
Expand Down

0 comments on commit 4b2fc85

Please sign in to comment.