shroom icon indicating copy to clipboard operation
shroom copied to clipboard

Destroying a furniture or its room context while in motion crashes

Open sindreslungaard opened this issue 5 years ago • 0 comments

Calling room.destroy() or item.destroy() while the item is in motion from a move() command causes the whole application to crash.

Example code to reproduce:

let shroom = Shroom.create({ application: app, resourcePath: "./resources/flash" })

let room = Room.create(shroom, {
    tilemap: `
    xxxxxxxx
    x000000x
    x000000x
    x000000x
    x000000x
    x000000x
    x000000x
    xxxxxxxx
    `,
});


let item = new FloorFurniture({
    roomX: 2,
    roomY: 2,
    roomZ: 0,
    type: "plant_pineapple",
    direction: 2
})

room.addRoomObject(item)

setTimeout(() => {
    item.move(3, 2, 0)
    item.destroy()
}, 2000);

app.stage.addChild(room)

sindreslungaard avatar Feb 19 '21 14:02 sindreslungaard