From 99edbf9cc85defe7872618135ae93f2d49e75edc Mon Sep 17 00:00:00 2001 From: Nikolay Borodin Date: Fri, 22 Nov 2024 14:42:40 +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..ff6d10b7660 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 == psDroid->pos.xy()) + { + 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");