fix build issues
This commit is contained in:
@@ -93,7 +93,7 @@ export function SlabPanel() {
|
||||
setEditingHoleIndex(null)
|
||||
}
|
||||
},
|
||||
[node?.holes, handleUpdate, editingHoleIndex],
|
||||
[node?.holes, handleUpdate, editingHoleIndex, setEditingHoleIndex],
|
||||
)
|
||||
|
||||
// Only show if exactly one slab is selected
|
||||
|
||||
@@ -34,7 +34,7 @@ export function AudioSettingsDialog() {
|
||||
</div>
|
||||
<Slider
|
||||
value={[masterVolume]}
|
||||
onValueChange={(value) => setMasterVolume(value[0])}
|
||||
onValueChange={(value) => value[0] !== undefined && setMasterVolume(value[0])}
|
||||
max={100}
|
||||
step={1}
|
||||
disabled={muted}
|
||||
@@ -49,7 +49,7 @@ export function AudioSettingsDialog() {
|
||||
</div>
|
||||
<Slider
|
||||
value={[radioVolume]}
|
||||
onValueChange={(value) => setRadioVolume(value[0])}
|
||||
onValueChange={(value) => value[0] !== undefined && setRadioVolume(value[0])}
|
||||
max={100}
|
||||
step={1}
|
||||
disabled={muted}
|
||||
@@ -64,7 +64,7 @@ export function AudioSettingsDialog() {
|
||||
</div>
|
||||
<Slider
|
||||
value={[sfxVolume]}
|
||||
onValueChange={(value) => setSfxVolume(value[0])}
|
||||
onValueChange={(value) => value[0] !== undefined && setSfxVolume(value[0])}
|
||||
max={100}
|
||||
step={1}
|
||||
disabled={muted}
|
||||
|
||||
@@ -468,14 +468,12 @@ export class SpatialGridManager {
|
||||
if (slab.polygon.length >= 3 && pointInPolygon(x, z, slab.polygon)) {
|
||||
// Check if point is in any hole
|
||||
let inHole = false
|
||||
if (slab.holes && slab.holes.length > 0) {
|
||||
for (const hole of slab.holes) {
|
||||
if (hole.length >= 3 && pointInPolygon(x, z, hole)) {
|
||||
inHole = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!inHole) {
|
||||
const elevation = slab.elevation ?? 0.05
|
||||
@@ -508,7 +506,6 @@ export class SpatialGridManager {
|
||||
// Check if item is entirely within a hole (if so, ignore this slab)
|
||||
// We consider it entirely in a hole if the item center is in the hole
|
||||
let inHole = false
|
||||
if (slab.holes && slab.holes.length > 0) {
|
||||
const [cx, , cz] = position
|
||||
for (const hole of slab.holes) {
|
||||
if (hole.length >= 3 && pointInPolygon(cx, cz, hole)) {
|
||||
@@ -516,7 +513,6 @@ export class SpatialGridManager {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!inHole) {
|
||||
const elevation = slab.elevation ?? 0.05
|
||||
@@ -548,7 +544,6 @@ export class SpatialGridManager {
|
||||
if (wallOverlapsPolygon(start, end, slab.polygon)) {
|
||||
// Check if wall midpoint is in a hole (if so, ignore this slab)
|
||||
let inHole = false
|
||||
if (slab.holes && slab.holes.length > 0) {
|
||||
const midX = (start[0] + end[0]) / 2
|
||||
const midZ = (start[1] + end[1]) / 2
|
||||
for (const hole of slab.holes) {
|
||||
@@ -557,7 +552,6 @@ export class SpatialGridManager {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!inHole) {
|
||||
const elevation = slab.elevation ?? 0.05
|
||||
|
||||
@@ -124,7 +124,6 @@ export function generateSlabGeometry(slabNode: SlabNode): THREE.BufferGeometry {
|
||||
shape.closePath()
|
||||
|
||||
// Add holes to the shape
|
||||
if (slabNode.holes && slabNode.holes.length > 0) {
|
||||
for (const holePolygon of slabNode.holes) {
|
||||
if (holePolygon.length < 3) continue
|
||||
|
||||
@@ -140,7 +139,6 @@ export function generateSlabGeometry(slabNode: SlabNode): THREE.BufferGeometry {
|
||||
|
||||
shape.holes.push(holePath)
|
||||
}
|
||||
}
|
||||
|
||||
// Extrude the shape by elevation
|
||||
const geometry = new THREE.ExtrudeGeometry(shape, {
|
||||
|
||||
Reference in New Issue
Block a user