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 errors caused by auras inside solid VBL #4204

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Jul 9, 2023

Identify the Bug or Feature request

#4203

Description of the Change

The cause of the error was that FogUtil.calculateVisibility() returns null when visibility is completely blocked by VBL Rather than add additional null checks to avoid the NPE, I've instead changed the result of FogUtil.calculateVisibility() to never be null. All callers already had to treat this case the same as an empty area (since that is what it signals), and can still take optimized code paths by checking if the area is empty rather than null.

Possible Drawbacks

None

Documentation Notes

N/A

Release Notes

  • Fixed a bug where auras inside solid VBL would generate repeated errors.

This change is Reviewable

Instead of `null` we now return an empty area. This saves on the need to check for null as all callers either behave the
same as for an empty area, or can check if the resulting area is empty if different action is needed.
@cwisniew cwisniew added this pull request to the merge queue Jul 15, 2023
Merged via the queue into RPTools:develop with commit 002ed2b Jul 15, 2023
@kwvanderlinde kwvanderlinde deleted the bugfix/4203-auras-error-when-no-visibility branch July 18, 2023 05:50
@kwvanderlinde kwvanderlinde linked an issue Jul 31, 2023 that may be closed by this pull request
@cwisniew cwisniew added the bug label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

[Bug 1.13.1]: Auras inside solid VBL crashes MapTool
2 participants