From f9396baaf849d30cca3bd7fe456597bff2d9cb83 Mon Sep 17 00:00:00 2001 From: KJeff01 Date: Sat, 2 Dec 2023 12:00:55 -0600 Subject: [PATCH 1/2] Return to base when set to retreat at a health level without HQ or repairs --- src/order.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/order.cpp b/src/order.cpp index c297804c246..7fb94c5a5b0 100644 --- a/src/order.cpp +++ b/src/order.cpp @@ -3302,6 +3302,11 @@ void secondaryCheckDamageLevel(DROID *psDroid) orderDroid(psDroid, DORDER_RTB, ModeImmediate); return; } + else if (result.type == RTR_TYPE_NO_RESULT) + { + orderDroid(psDroid, DORDER_RTB, ModeImmediate); + return; + } else if (result.type == RTR_TYPE_DROID) { ASSERT(result.psObj != nullptr, "RTR_DROID but target is null"); From c10a45478e90f286ce49b4d68e7811a37eb3ee77 Mon Sep 17 00:00:00 2001 From: KJeff01 Date: Sat, 2 Dec 2023 12:32:20 -0600 Subject: [PATCH 2/2] Check startPosition coordinates for RTB when no HQ exists in mp Retreats units back to the startPosition area much like campaign does for LZ data. --- src/order.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/order.cpp b/src/order.cpp index 7fb94c5a5b0..912029b351b 100644 --- a/src/order.cpp +++ b/src/order.cpp @@ -1667,12 +1667,18 @@ void orderDroidBase(DROID *psDroid, DROID_ORDER_DATA *psOrder) // see if the LZ has been set up int iDX = getLandingX(psDroid->player); int iDY = getLandingY(psDroid->player); + Vector2i startPos = getPlayerStartPosition(psDroid->player); if (iDX && iDY) { psDroid->order = *psOrder; actionDroid(psDroid, DACTION_MOVE, iDX, iDY); } + else if (bMultiPlayer && (startPos.x != 0 && startPos.y != 0)) + { + psDroid->order = *psOrder; + actionDroid(psDroid, DACTION_MOVE, startPos.x, startPos.y); + } else { // haven't got an LZ set up so don't do anything