Skip to content

Commit

Permalink
FIX: Audio rulers interrupt cursor skip over water
Browse files Browse the repository at this point in the history
  • Loading branch information
LevFendi committed Oct 26, 2024
1 parent 0f51703 commit 62e942e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Version 0.15.2 BETA
Released on October 25th, 2024.
Released on October 26th, 2024.

## Summary
- This quick update improves the grouping of the new scanner and fixes some bugs in the scanner and the launcher.
Expand All @@ -23,6 +23,8 @@ Released on October 25th, 2024.

- Single-time train travel has been reverted such that a train resumes its old schedule after the player exits upon arriving at the temporary station. This was needed for fixing an issue about trains skipping stations.

- Fixed that cursor skipping does not pick up audio rulers when starting over water.


# Version 0.15.1 BETA
Released on October 19th, 2024.
Expand Down
10 changes: 10 additions & 0 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7281,6 +7281,16 @@ function cursor_skip_iteration(pindex, direction, iteration_limit)
--Water tile -> non-water tile found
return moved
else
--For audio rulers, stop if crossing into or out of alignment with any rulers
local current_tile_is_ruler_aligned = Rulers.is_any_ruler_aligned(pindex, players[pindex].cursor_pos)
if start_tile_is_ruler_aligned ~= current_tile_is_ruler_aligned then
Rulers.update_from_cursor(pindex)
return moved
--Also for rulers, stop if at the definiton point of any ruler
elseif Rulers.is_at_any_ruler_definition(pindex, players[pindex].cursor_pos) then
Rulers.update_from_cursor(pindex)
return moved
end
--Iterate again
players[pindex].cursor_pos = fa_utils.offset_position(players[pindex].cursor_pos, direction, 1)
selected_tile_is_water = fa_utils.tile_is_water(p.surface, players[pindex].cursor_pos)
Expand Down

0 comments on commit 62e942e

Please sign in to comment.