From 05c054cbe2249feda3637cabfe122b75241113e9 Mon Sep 17 00:00:00 2001 From: Tom J Nowell Date: Fri, 11 Sep 2026 17:14:32 +0100 Subject: [PATCH] Snap the early build block check to the real build position (#3268) The early block check added in #2557 runs on a position snapped to 8 elmos, while the build itself uses Pos2BuildPos, which snaps to 16 and adds half a square for an odd footprint. For an odd footprint the check therefore evaluates a footprint 8 elmos away from the one that would be placed, and can drop a build order the build itself would accept. Pos2BuildPos is idempotent, so the later call at MoveInBuildRange is left alone rather than moved, keeping the change to the check itself. --- rts/Sim/Units/CommandAI/BuilderCAI.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rts/Sim/Units/CommandAI/BuilderCAI.cpp b/rts/Sim/Units/CommandAI/BuilderCAI.cpp index e1faddb7dd6..8e888671929 100644 --- a/rts/Sim/Units/CommandAI/BuilderCAI.cpp +++ b/rts/Sim/Units/CommandAI/BuilderCAI.cpp @@ -611,6 +611,9 @@ void CBuilderCAI::ExecuteBuildCmd(Command& c) // is never parsed (except in PostLoad) so just copy it build = bi; + // snap to the position the build will actually use, so the early check + // below tests the same footprint the rest of this function does + build.pos = CGameHelper::Pos2BuildPos(build, true); inCommand = c.GetID(); // One-time early check: if repeating the order (or first run), skip immediately if now blocked