Avoid revealing hidden tiles when selecting automove destination on CURSES #40194
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Bugfixes "Fix selecting automove destination would reveal hidden tiles on CURSES"
Purpose of change
To draw a line, CURSES version draws all tiles the line passes through but with inverted colors. The function that determines symbol and color and prints it is also responsible for committing said symbol to memory. The automove's path can pass through unrevealed tiles, causing the drawing function to scan these unrevealed tiles and commit them to memory.
Describe the solution
Filter line points by visibility and use a separate method for selecting symbol & color of hidden points.
Describe alternatives you've considered
Making the new visibility check always enabled. Don't know how that would affect performance for other cases though.
Testing
It compiles and looks as expected
Additional context
Before
After