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

Set transparency cache dirty when placing a vehicle. #78428

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

kevingranade
Copy link
Member

Summary

None

Purpose of change

There's an intermittent but common test failure that has been cropping up recently that looks like:

../tests/vehicle_fake_part_test.cpp:349
../tests/vehicle_fake_part_test.cpp:363: FAILED:
CHECK( !you.sees( you.pos_bub() + point( 10, 10 ) ) )
with expansion:
false

Scanning through test runs, it looks like the first place it happened was https://github.com/CleverRaven/Cataclysm-DDA/actions/runs/12087387906/job/33711062255 but that doesn't seem to be cause, it looks like #78104 is a likely culprit.
I'm not sure if this is visible in-game, because it's likely that the transparency cache at the vehicle's location gets invalidated before it comes into view anyway, but in tests we need to be able to set the scene in a more ad-hoc way.

Describe the solution

Add a transparency cache invalidation for each tile of a vehicle when it's added to the map.

Describe alternatives you've considered

I'm a little concerned about there being missing invalidations elsewhere as well, but I'm not up to digging into it right now.

Testing

Unfortunately I can't get this to reproduce locally so this is all analysis based, but worst case it should be harmless?

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Dec 8, 2024
@Night-Pryanik Night-Pryanik merged commit 86fcd36 into master Dec 9, 2024
24 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants