Restored tile editing and proper map clearing behavior
This commit is contained in:
@ -98,16 +98,17 @@ function save() {
|
||||
const currentMap = mapEditor.currentMap.value
|
||||
if (!currentMap) return
|
||||
|
||||
console.log(currentMap.tiles)
|
||||
const data = {
|
||||
mapId: {...currentMap},
|
||||
mapId: currentMap.id,
|
||||
name: currentMap.name,
|
||||
width: currentMap.width,
|
||||
height: currentMap.height,
|
||||
tiles: {...currentMap.tiles},
|
||||
tiles: currentMap.tiles,
|
||||
pvp: currentMap.pvp,
|
||||
mapEffects: {...currentMap.mapEffects},
|
||||
mapEventTiles: {...currentMap.mapEventTiles},
|
||||
placedMapObjects: currentMap.placedMapObjects?.map(({ id, mapObject, depth, isRotated, positionX, positionY }) => ({ id, mapObject: {...mapObject}, depth, isRotated, positionX, positionY })) ?? []
|
||||
mapEffects: currentMap.mapEffects,
|
||||
mapEventTiles: currentMap.mapEventTiles,
|
||||
placedMapObjects: currentMap.placedMapObjects.map(({ id, mapObject, depth, isRotated, positionX, positionY }) => ({ id, mapObject: {...mapObject}, depth, isRotated, positionX, positionY })) ?? []
|
||||
}
|
||||
|
||||
gameStore.connection?.emit('gm:map:update', data, (response: MapT) => {
|
||||
@ -127,5 +128,6 @@ function clear() {
|
||||
|
||||
// Clear placed objects, event tiles and tiles
|
||||
mapEditor.clearMap()
|
||||
mapEditor.triggerClearTiles()
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user