Skip to content

fix: Simplify sightline algorithm and fix asymmetry#724

Open
jprzimba wants to merge 1 commit into
mainfrom
fix-block-walls
Open

fix: Simplify sightline algorithm and fix asymmetry#724
jprzimba wants to merge 1 commit into
mainfrom
fix-block-walls

Conversation

@jprzimba
Copy link
Copy Markdown
Collaborator

Replace the previous Xiaolin Wu based sight-line tracing with a simpler integer-stepping approach using line coefficients (a, b, c) and explicit stepX/stepY decisions.

The new loop advances along the major/minor directions by comparing move costs and checks tiles for CONST_PROP_BLOCKPROJECTILE as it goes.

Also update isSightClear to try the reverse ray when on the same floor and the forward check fails to handle asymmetric corner cases.
This simplifies the code, reduces special-case branches (horizontal/vertical), and fixes sight asymmetry around solid tiles. Related issue #709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant