[0.16.7 Stacking ghosts with LuaSurface::create_entity
Posted: Thu Dec 21, 2017 9:36 pm
I am making a mod where I do something with ghost. I noticed that it is possible to stack ghosts on top of eachother using LuaSurface::create_entity in on_built_item(possibly in the other events too). This is a bug in my mod ofcourse but I also think it is a bug in the placing of a ghost. Two(or as in the picture 5 or 6 or more) equal ghosts on top of each other does not seem like a viable thing to me.
What I did
Removing the created entity using event.created_entity.destroy()
Recreating a previous ghost using game.players[event.player_index].sursurface.create_entity(entityToCreate)
What I expect
The old ghost being destroyed by the created_entity (this is where I have a bug in my mod)
A new copy of the old ghost being placed.
What did I get
A new copy on top of the old ghost
A brighter ghost.
What I did
Removing the created entity using event.created_entity.destroy()
Recreating a previous ghost using game.players[event.player_index].sursurface.create_entity(entityToCreate)
What I expect
The old ghost being destroyed by the created_entity (this is where I have a bug in my mod)
A new copy of the old ghost being placed.
What did I get
A new copy on top of the old ghost
A brighter ghost.