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

Flush aura cache when tokens with auras are changed #4058

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented May 12, 2023

Identify the Bug or Feature request

Fixes #4057

Description of the Change

Auras were being cleared based on the vision and lighting properties of the token. Auras have nothing to do with these, so the cache was not being reliably cleared. Now we check auras separately, and if the token either has or had an aura we clear the drawableAuras cache.

Some cleanup as well: the lightSourceMap was simplified by guaranteeing that all keys will exist and be mapped to valid sets. This avoids the need to check on every access, making things easier to follow and avoiding easy-to-introduce NPEs (I hit this on my first take).

Possible Drawbacks

Should be none.

Documentation Notes

N/A

Release Notes

  • Fixed a bug where auras would still be rendered after being removed from a token.

This change is Reviewable

The `drawableAura` cache was optionally flushed based on whether the token currently has light sources or contributions
to an illumination. Auras don't interact with illumination, so this was missing tokens that used to have auras but now
have no light sources.

The new checks separate auras from normal lights. The aura cache is now cleared whenever the token is recognized as an
aura source, or just been given an aura.
@cwisniew cwisniew merged commit 738eb86 into RPTools:release-1.13 May 13, 2023
@cwisniew cwisniew added the bug label May 16, 2023
@kwvanderlinde kwvanderlinde deleted the bugfix/4057-flush-aura-cache-when-auras-removed branch May 16, 2023 16:42
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