shanemadden / factorio-deadlock-beltboxes-loaders

Other
8 stars 16 forks source link

Incorrect snapping to belt when replacing a loader with another loader #26

Open curiosity-a opened 3 years ago

curiosity-a commented 3 years ago

A way to reproduce:

  1. Place an inventory.
  2. Place a belt facing the inventory with one tile inbetween.
  3. Place a loader onto that tile, with its loading side pointing into the inventory. Note that it snaps correctly to load from belt to inventory.
  4. Replace the loader with another one in the above orientation (in practice this would be a loader of a different tier, but for the bug it doesn't matter). Note that the loader changes both orientation and direction, its loading side pointed at the belt, belt side poined at the inventory, direction from belt to inventory.
Deadlock989 commented 3 years ago

Can reproduce. From testing there is something very slightly off about the snapping logic section that begins "elseif are_loadable(belt_end) then", possibly being caused by it being a fast-replace event? Not sure.

Glockshna commented 1 year ago

@Deadlock989 Not sure if you're still working on this, but I did some testing and made a video of the different ways I've been able to trigger this.

https://dl.dropboxusercontent.com/s/425f9ls5f7ncz6r/factorio_mLGZOUws6t.mp4

And for anyone stumbling upon this looking for a workaround, turning both of these options off seems to fix the issue for now as it disables the fucky function mentioned above.

these options

Not sure if this helps at all.

You've likely already thought of this but just in case, if I had the time or inclination I might look at returning out of local function on_built_entity(event)

If it's being called on a quick replace event, but because quick replace itself seems to work fine as long as this function is out of the equation.

Deadlock989 commented 1 year ago

@Deadlock989 Not sure if you're still working on this,

Hi - I handed custody of this mod over in 2019.