Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always retreat units back to LZ or starting position #3557

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -3302,6 +3308,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");
Expand Down
Loading