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 authored and KJeff01 committed Dec 8, 2024
1 parent 7856e43 commit 0506f44
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 == 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");
Expand Down

0 comments on commit 0506f44

Please sign in to comment.