Skip to content

Commit

Permalink
Fixed bug: can't build if the droid is centered in the tile
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich committed Nov 22, 2024
1 parent 96ce8bf commit 87e3dc7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 87e3dc7

Please sign in to comment.