NiftyManiac / factorio-stickynotes

StickyNotes mod for Factorio
MIT License
2 stars 6 forks source link

Notes don't get deleted in some circumstances #7

Closed NiftyManiac closed 7 years ago

NiftyManiac commented 7 years ago

A ghost with a note is placed. If a new building is placed on top of the ghost, the ghost dies but the note stays alive.

NiftyManiac commented 7 years ago

on_preplayer_mined_item is fired when a note is destroyed via right-click. Nothing is fired if

Nexela commented 7 years ago

Could probably be solved by not reviving the invis-note until after the entity it is placed with is revived.
This would also have an added benefit of indexing the note on the unit_number of the entity resulting in faster lookups

NiftyManiac commented 7 years ago

Not a fan of that idea... I don't like ghosts having invisible state that only shows up when they're built. Though I can't think of a better fix besides searching all nearby entities on every on_construction. Maybe I can use on_put_item to figure out what ghosts will be deleted by the placement.

NiftyManiac commented 7 years ago

Damn, ghosts disappearing via deconstruction planner seems completely undetectable.

NiftyManiac commented 7 years ago

Mostly fixed. Only time a note fails to be removed is if a ghost is deconstructed without the invis_note. Probably nothing I can do there, since no events are fired.