🆙 Fix floorplanner

This commit is contained in:
duckietm
2026-03-11 13:38:50 +01:00
parent ec0aef3c41
commit 37bdcf7ef8
@@ -411,31 +411,26 @@ export class FloorplanEditor
public getCurrentTilemapString(): string
{
const highestTile = this._tilemap[this._height - 1][this._width - 1];
this._width = 0;
this._height = 0;
if(highestTile.height === 'x')
for(let y = MAX_NUM_TILE_PER_AXIS - 1; y >= 0; y--)
{
this._width = -1;
this._height = -1;
if(!this._tilemap[y]) continue;
for(let y = MAX_NUM_TILE_PER_AXIS - 1; y >= 0; y--)
for(let x = MAX_NUM_TILE_PER_AXIS - 1; x >= 0; x--)
{
if(!this._tilemap[y]) continue;
if(!this._tilemap[y][x]) continue;
for(let x = MAX_NUM_TILE_PER_AXIS - 1; x >= 0; x--)
const tile = this._tilemap[y][x];
if(tile.height !== 'x')
{
if(!this._tilemap[y][x]) continue;
if((x + 1) > this._width)
this._width = x + 1;
const tile = this._tilemap[y][x];
if(tile.height !== 'x')
{
if((x + 1) > this._width)
this._width = x + 1;
if((y + 1) > this._height)
this._height = y + 1;
}
if((y + 1) > this._height)
this._height = y + 1;
}
}
}
@@ -489,6 +484,12 @@ export class FloorplanEditor
if(!tile || tile.isBlocked) continue;
tile.height = shouldUnset ? 'x' : this._actionSettings.currentHeight;
if(!shouldUnset)
{
if((x + 1) > this._width) this._width = x + 1;
if((y + 1) > this._height) this._height = y + 1;
}
}
}