-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Prevent vehicles spawning inside others #78406
base: master
Are you sure you want to change the base?
Prevent vehicles spawning inside others #78406
Conversation
3b62c80
to
e791afc
Compare
Won’t this break car wreck extras? |
No (if it was working) it doesn't prevent partially overlapping vehicles spawning |
Never encountered vehicle overlap. Will break wrecks though. Picture doesn't show vehicle overlap lookes like a crash. |
Overlapping vehicles are how you form wrecks, the screenshot is courtesy of Maarifrah pointing out this is a problem for #78382, not a crash |
Summary
None
Purpose of change
This is dumb
Having a hardcoded solution just for trying to spawn shopping carts on other vehicles (not even vice versa) is also dumb
Describe the solution
Prevent spawning vehicles if either vehicles tripoints are a subset of (or the same as) the others
Adds a unit test to check stuff is working properly
Describe alternatives you've considered
Ideally this would allow for crashes where one vehicle is a subset of the other but it still looks believable
eg
hits
like
But handling that without allowing other nonsense or making the check expensive seems difficult
Testing
Having some trouble with the normal intersection test, see unit test comments
Ok I'm extra confused, adding a check at the end for
passes every time which makes it seem like it's just incorrectly returning nullptr but then if I load up the resulting test save (with the last two destroy_vehicle s commented out and tping the pc nearby) there's only 4 vehicle tiles in a square not the reported 5 in a U
Additional context