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

Remove road vehicles from mine field #79908

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PatrikLundell
Copy link
Contributor

@PatrikLundell PatrikLundell commented Feb 28, 2025

Summary

None

Purpose of change

Fix #79889, i.e. minefield placement generating errors due to collision with road generated vehicles.

Describe the solution

Remove all vehicles that may have been generated by the road generation before placing the mine field stuff.

Describe alternatives you've considered

Only remove vehicles that overlap with placed vehicles. Decided against it as it doesn't make sense to have both sets of vehicles at the OMT (and it can presumably cause other problems as well).

Testing

Created a new coded map extra placed on roads with a southern road connection (to match the double humvee minefield orientation) and added the JSON for it with a weight of 1000000.
Created a test for this map extra based on the one for the mine field.
Added log output in the map extra code to print what vehicles were present before the code got to work.
Ran the new test and saw similar symptoms as for the failed minefield test.
Changed the code to remove the pre generated vehicles.
Saw there were still weird errors generated.
Changed the map load to load vehicles properly.
Only saw the logs stating vehicles were detected (line before they were removed), but no errors.

Changed the minefield code as per this PR based on the above.

Additional context

This problem may occur with other map extras that spawn on top of a base that can spawn vehicles on the base OMT. I have made no attempt to investigate this.

I haven't tracked down why the vehicle placement on top of other vehicles resulted in out of bounds errors. There may still be a bug hiding there. My debug output didn't report any vehicles placements that seemed dangerous as far as I noted.

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 28, 2025
@PatrikLundell
Copy link
Contributor Author

The failure is a damned birdshot vs adobe wall again...

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 <Bugfix> This is a fix for a bug (or closes open issue) [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.

Test reveals bugged mx_minefield generation
1 participant