[1.1.105] Smart belt dragging state can be manipulated persistently to alter build range

Post your bugs and problems so we can fix them.
Post Reply
xykite
Inserter
Inserter
Posts: 24
Joined: Thu Jul 30, 2020 9:39 pm
Contact:

[1.1.105] Smart belt dragging state can be manipulated persistently to alter build range

Post by xykite »

Minor issue.

It is possible through normal play to set the smart belt 'snap dragging' range to either 10 or 20, and this will persist through building attempts.

Firstly the setup to test the range:
  • Place a vertical belt and keep the LMB held down.
  • Walk roughly 20 squares right of the belt without moving the cursor vertically, end with the cursor near you.
  • Press 'R' to make a horizontal section of belt appear by snap dragging, then let go of LMB1.
  • If the new sections of belt are all within the normal build radius of the current player then the range is 10. If some of the new sections of belt are between 11 and 20 of the player then the range is 20.
Changing the internal state:
  • To set the range to 10: Attempt to build a single item out of range, observe the 'Cannot reach' error.
  • To set the range to 20: Attempt to build an item over the top of another such that no build action happens. This must be within the player build range. For instance: built a belt, then click again to attempt to build the same belt over the top.
In both cases the smart belt 'snap dragging' range will then persist through discrete smart belt building attempts.

Expected result: I don't know what the correct snap dragging range should be, as the two methods of changing it are both common actions. However I expect that the range should be consistent, and that state like this should not be preserved between discrete smart belt building sessions.

In the attached replay I create 5 sections of belt from the left concrete path to the right path, following the steps above.
  • First I create a belt section to show the default range is 20.
  • Then I change the range to 10 by attempting to build a belt out of range of the character (the 'Cannot reach' error doesn't show on replay).
  • Then I create two belt sections, both end up having range 10.
  • Then I change the range to 20 by building the orphaned belt to the left, then trying to build it again.
  • Then I create two belt sections, both end up having range 20.
I think this is due to how the flags InputHandlerAllegro.thisDraggingWasInReach and InputHandlerAllegro.thisDraggingLineWasInReach persist through build attempts - changing these in-memory sets the range to 10 (if both false) or 20 (if both true).
Attachments
factorio-current.log
(5.33 KiB) Downloaded 17 times
smartrange.zip
(1.8 MiB) Downloaded 12 times


xykite
Inserter
Inserter
Posts: 24
Joined: Thu Jul 30, 2020 9:39 pm
Contact:

Re: [1.1.105] Smart belt dragging state can be manipulated persistently to alter build range

Post by xykite »

I think it is - actually your post motivated me to chase down this problem of the range being inconsistent. I'll post a comment.

Post Reply

Return to “Bug Reports”