From 87e3dc7696ff2b0472b741215462d64947309cf9 Mon Sep 17 00:00:00 2001 From: Nikolay Borodin Date: Fri, 22 Nov 2024 14:08:26 +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..337246e8f4b 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) + { + actionRemoveDroidsFromBuildPos(psDroid->player, psDroid->actionPos, order->direction, order->psStats); + } + 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");