Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for visible area being confused with illuminated area #4044

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented May 8, 2023

Identify the Bug or Feature request

Fixes #4043

Description of the Change

Change ZoneView.getVisibleArea(PlayerView) to return token vision restricted to illuminated areas rather than returning the entire illuminated area for the view.

I also put in some simplifications for things that bother me, i.e., the fact that calculateVisibleArea() is a separate method, and that VisibleAreaMeta does nothing but transparently wrap an Area.

Possible Drawbacks

Should be none.

Documentation Notes

None

Release Notes

  • Fixed a bug where some rendering was not restricted to token vision.

This change is Reviewable

kwvanderlinde and others added 3 commits May 8, 2023 16:09
Rather than returning the entire illuminated area from `ZoneView.getVisibleArea(PlayerView)`, we now go back to
returning only the illuminated area that is also covered by the vision of at least one of the view's tokens.
The `calculateVisibleArea` method has been folded into `getVisibleArea(PlayerView)`. This lets us directly use
`computeIfAbsent` and return its result, giving a more robust implementation and requiring fewer redundant checks.

The `VisibleAreaMeta` class has been removed in favour of directly using `Area`. No functionality depended on
`VisibleAreaMeta`, and removing it simplies the use of the `visibleAreaMap` cache.
@cwisniew cwisniew merged commit 7c4ad10 into RPTools:release-1.13 May 9, 2023
@kwvanderlinde kwvanderlinde deleted the bugfix/4043-visible-area-confused-with-illuminated-area branch May 9, 2023 04:17
@cwisniew cwisniew added the bug label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants