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

Random stab at fixing test failure #30972

Merged
merged 1 commit into from
May 30, 2019
Merged

Conversation

kevingranade
Copy link
Member

Summary

SUMMARY: None

Purpose of change

Looks like I broke something about lightmap initialization in #30940
There's a vision test failing consistently now, and it bisects to this change at least.

Describe the solution

If this works it's because I accidentally cleared the seen cache at the player's location and this restores it to visibility.

If this works it's because I accidentally cleared the seen cache at the player's location and this restores it to visibility.
@KorGgenT KorGgenT added [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. labels May 30, 2019
@kevingranade
Copy link
Member Author

That did it, for posterity, what was happening is:
I accidentally cleared the tile the player is standing on in the seen cache.
Shadowcasting doesn't set this tile, so it remained unset, but it doesn't usually cause a problem since the player's avatar is drawn regardless of visibility.
map::apparent_light_helper() checks the tile adjacent to a wall in the direction of the player for visibility to determine if illumination of that side of the wall should contribute to apparent lighting.
If the player is standing adjacent to a wall, that adjacent tile is now "not visible to the player", since shadowcasting never set it. therefore the wall itself does not count as illuminated.

tl;dr hooray for unit tests.

@kevingranade kevingranade merged commit 1a7234e into master May 30, 2019
@kevingranade kevingranade deleted the kevingranade-fix-vision-test branch June 6, 2019 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants