Skip to content

Commit

Permalink
Fix wall construction whereas builder was dropped **twice** from buil…
Browse files Browse the repository at this point in the history
…ding(blocking one extra tile).
  • Loading branch information
Jarod42 committed Aug 7, 2023
1 parent 8fc8d82 commit 519f10c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/action/action_built.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void CancelBuilt(COrder_Built &order, CUnit *unit)
CUnit *worker = order.GetWorkerPtr();

// Drop out unit
if (worker != nullptr && worker->CurrentAction() == UnitActionBuild) {
if (worker != nullptr && worker->CurrentAction() == UnitActionBuild && !worker->CurrentOrder()->Finished) {
worker->ClearAction();

DropOutOnSide(*worker, LookingW, unit);
Expand Down Expand Up @@ -222,6 +222,7 @@ static void Finish(COrder_Built &order, CUnit &unit)
// FIXME: Johns: hardcoded unit-type wall / more races!
if (&type == UnitTypeOrcWall || &type == UnitTypeHumanWall) {
Map.SetWall(unit.tilePos, &type == UnitTypeHumanWall);
order.Finished = true;
unit.Remove(nullptr);
UnitLost(unit);
UnitClearOrders(unit);
Expand Down

0 comments on commit 519f10c

Please sign in to comment.