From 1bc2f63e108dffe0f058d9ac2e7968f8fc8dfe43 Mon Sep 17 00:00:00 2001 From: Monsterovich Date: Fri, 22 Nov 2024 05:45:30 +0200 Subject: [PATCH] Fixed bug: can't build if the droid is centered in the tile --- src/action.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/action.cpp b/src/action.cpp index 2452cb95cf0..bda6cdf7997 100644 --- a/src/action.cpp +++ b/src/action.cpp @@ -2495,7 +2495,15 @@ static void actionDroidBase(DROID *psDroid, DROID_ACTION_DATA *psAction) psDroid->action = DACTION_MOVETOBUILD; psDroid->actionPos.x = psAction->x; psDroid->actionPos.y = psAction->y; - moveDroidToNoFormation(psDroid, psDroid->actionPos.x, psDroid->actionPos.y); + // Move a droid in a tile if it has never been moved before + if (psDroid->actionPos.x == psDroid->pos.x && psDroid->actionPos.y == psDroid->pos.y) + { + moveDroidToNoFormation(psDroid, psDroid->actionPos.x, psDroid->actionPos.y + 1); + } + else + { + moveDroidToNoFormation(psDroid, psDroid->actionPos.x, psDroid->actionPos.y); + } break; case DACTION_DEMOLISH: ASSERT_OR_RETURN(, order->type == DORDER_DEMOLISH, "cannot start demolish action without a demolish order");