stop a second tower stamping behind the Pokemon Tower

The tower's twelve ROUTE_10 rows are `gabled_block_6x6` tile for tile --
the artist drew the top of the tower as an ordinary six-cell block -- so
that template matched at (24,132) and stood a whole second building
behind it. Templates were matched and stamped independently, with
nothing stopping two grids claiming one drawing.

Placement is now first-claim-wins: a template never stamps into cells
another already claimed, which makes the list order the priority order.
The tower's own two templates move to the front so they take those
cells first.

Also corrects the split: the Route 10 half is TWELVE rows, not eight --
the 64px purple roof band plus two window courses -- so topRows and the
claimOnly twin now carry all of it, and the model is the complete
twenty-row drawing (96px facade under a real 64px roof). Both templates
verified to place exactly once world-wide.

The mound probe gains a MOUND_LEVEL knob; the low rungs are where this
was visible.
This commit is contained in:
DramaticShape
2026-07-27 04:52:52 -04:00
parent 0b8730fbf6
commit 2ff518a6d1
3 changed files with 102 additions and 71 deletions
+21 -1
View File
@@ -627,7 +627,27 @@ function Buildings.build(S, map, data, perRow)
for ty = 0, th - bh do
Budget.tick()
for tx = 0, tw - bw do
if S.tileAt[keyOf(tx, ty)] == first and matches(S, t, tx, ty) then
-- A placement never stamps into cells another template already
-- claimed. Templates are matched independently, and one
-- drawing can satisfy two grids: the Pokemon Tower's upper
-- twelve rows on ROUTE_10 are a standard 6-cell block tile for
-- tile, so `gabled_block_6x6` matched there and stood a whole
-- second building behind the tower. First claim wins, so the
-- list order below is the priority order -- the tower's own
-- templates come first precisely so they take those cells.
local free = S.tileAt[keyOf(tx, ty)] == first
if free then
for r = 0, bh - 1 do
for c = 0, bw - 1 do
if S.skip[keyOf(tx + c, ty + r)] then
free = false
break
end
end
if not free then break end
end
end
if free and matches(S, t, tx, ty) then
if not built then
local key = tileset.id .. ":" .. index
if not models[key] then