fix(map): transparent spaces in art overlays and register missing tiles - #17
fix(map): transparent spaces in art overlays and register missing tiles#17s6pa1rta3n-lab wants to merge 6 commits into
Conversation
|
This one no longer merges into
If you rebase it on today's One thing worth checking while rebasing: another contributor opened a pull request |
0bbaba6 to
415aaee
Compare
|
Rebased onto latest |
|
Rebased onto current main, resolved any conflicts, and verified all tests pass cleanly. |
|
Rebased on latest |
|
Gracias por rebasear los cuatro, se nota y sirve. Tres ya estan en
Los tres con el CI entero en verde y Este quedo en conflicto justo por el merge de #18: los dos tocan |
415aaee to
62517f5
Compare
|
@leocagli The rebase is complete and all 65 tests are passing (70 tests in the latest main). 517+ assertions are green. |
|
Hola @leocagli! El PR para los espacios transparentes en el mapa está rebasado y pasando todos los test suites. Listo para revisión y merge cuando tengas un momento. ¡Muchas gracias! |
62517f5 to
3c30ebb
Compare
| for (let row = 0; row < PLAZA_FOUNTAIN.art.length; row++) { | ||
| write(PLAZA_FOUNTAIN.x, PLAZA_FOUNTAIN.y + row, PLAZA_FOUNTAIN.art[row]) | ||
| const artRow = PLAZA_FOUNTAIN.art[row] | ||
| const first = artRow.search(/\S/) | ||
| if (first === -1) continue | ||
| let last = artRow.length - 1 | ||
| while (last > first && artRow[last] === ' ') last-- | ||
| fill(PLAZA_FOUNTAIN.x + first, PLAZA_FOUNTAIN.y + row, last - first + 1, 1, ' ') | ||
| write(PLAZA_FOUNTAIN.x, PLAZA_FOUNTAIN.y + row, artRow) | ||
| } |
There was a problem hiding this comment.
⚠️ Bug: Fountain overlay stamps padding spaces as solid, re-creating invisible walls
In civicSquare(), write() was reverted to stamp every character including spaces, and it is called with the full 47-char padEnd'd artRow starting at PLAZA_FOUNTAIN.x. Since ' ' is registered as a solid 'building' tile (line 62), every leading indentation space and every trailing padEnd space is written as a solid tile, producing a ~47-wide solid rectangle across all 19 fountain rows in the plaza — exactly the invisible-wall bug (#6) this PR claims to fix. The first/last computation and the preceding fill(...) are effectively dead code because the subsequent write() overwrites the same span and the full padded remainder. Fix: only render the trimmed art span so surrounding cobblestone stays walkable, e.g. fill [first..last] to make interior gaps solid, then write only the substring: write(PLAZA_FOUNTAIN.x + first, PLAZA_FOUNTAIN.y + row, artRow.slice(first, last + 1)).
Write only the trimmed art span so leading/trailing padding spaces don't become solid tiles, while fill keeps interior gaps solid.:
for (let row = 0; row < PLAZA_FOUNTAIN.art.length; row++) {
const artRow = PLAZA_FOUNTAIN.art[row]
const first = artRow.search(/\S/)
if (first === -1) continue
let last = artRow.length - 1
while (last > first && artRow[last] === ' ') last--
fill(PLAZA_FOUNTAIN.x + first, PLAZA_FOUNTAIN.y + row, last - first + 1, 1, ' ')
write(PLAZA_FOUNTAIN.x + first, PLAZA_FOUNTAIN.y + row, artRow.slice(first, last + 1))
}
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Code Review
|
| Auto-apply | Compact |
|
|
Important
Your trial ends in 4 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.
Was this helpful? React with 👍 / 👎 | Gitar
Summary
Closes #6
This PR resolves the invisible walls issue in the plaza and across maps:
write()inmakeHighResolutionCityRows()(lib/map.js) to ignore spaces (if (ch === ' ') continue) when rendering art overlays/strings so that underlying walkable cobblestones/roads are not overwritten with solid space characters.' ','=','',"'"- representing 24.9% of glyphs in maps) to theTILESdictionary so they are explicitly defined rather than defaulting toNOWHERE`.test/index.jsto assert that all map characters are defined inTILESand that the plaza fountain perimeter is clear of invisible solid space tiles.Testing
npm testpassed.node test/map.smoke.jspassed.npm run lintpassed with 0 errors.Payout Routing
0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC