From 4b2fc855bb315b3f0a80a95e3e7510981308f35a Mon Sep 17 00:00:00 2001 From: KJeff01 Date: Mon, 16 Oct 2023 22:48:21 -0500 Subject: [PATCH] Fix the horrid VTOL Strike/CB rearming behavior 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. --- src/order.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/order.cpp b/src/order.cpp index 5a4f2ac1846..75ac1cd77d7 100644 --- a/src/order.cpp +++ b/src/order.cpp @@ -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)) @@ -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; }