Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions lib/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ const TILES = {
o: { id: 'rock', name: 'una piedra', solid: true },
t: { id: 'tree', name: 'un arbol', solid: true },
'~': { id: 'water', name: 'el agua', solid: true },
' ': { id: 'building', name: 'un edificio', solid: true },
'=': { id: 'wall', name: 'una pared', solid: true },
"'": { id: 'ornament', name: 'un adorno', solid: true },
Comment thread
gitar-bot[bot] marked this conversation as resolved.
H: { id: 'ornament', name: 'un adorno', solid: true },

C: { id: 'door.home', name: 'tu casa', solid: false, enter: { kind: 'home' } },
I: { id: 'door.church', name: 'la iglesia', solid: false, enter: { kind: 'church' } },
Expand Down Expand Up @@ -750,7 +754,11 @@ function makeHighResolutionCityRows() {
}
}
const write = (x, y, text) => {
for (let i = 0; i < String(text).length; i++) set(x + i, y, String(text)[i])
for (let i = 0; i < String(text).length; i++) {
const ch = String(text)[i]
if (ch === ' ') continue
set(x + i, y, ch)
}
}
Comment thread
gitar-bot[bot] marked this conversation as resolved.
const centred = (x, y, w, text) => write(x + Math.floor((w - String(text).length) / 2), y, text)
const border = (x, y, w, h, horizontal = '-', vertical = '|') => {
Expand Down Expand Up @@ -1094,7 +1102,14 @@ function makeHighResolutionCityRows() {
' /~~~~~~~~~~~~~~~~~~~~\\ ',
' \\____________________/ '
]
for (let row = 0; row < art.length; row++) write(x, y + row, art[row])
for (let row = 0; row < art.length; row++) {
const first = art[row].search(/\S/)
if (first === -1) continue
let last = art[row].length - 1
while (last > first && art[row][last] === ' ') last--
fill(x + first, y + row, last - first + 1, 1, ' ')
write(x, y + row, art[row])
}
}

const market = (x, y, w) => {
Expand Down Expand Up @@ -1155,7 +1170,13 @@ function makeHighResolutionCityRows() {
write(lx, ly + 1, '|*')
}
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)
}
}

Expand Down Expand Up @@ -1515,7 +1536,13 @@ function makeRunaCapitalRows() {
set(tx, ty - 1, '*')
}
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)
}
Comment on lines 1538 to 1546

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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 👍 / 👎

}

Expand Down
Loading