-
Notifications
You must be signed in to change notification settings - Fork 175
Fix missiles passing through medistation #3291
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
Conversation
Fixes Unvanquished#3275: pointAgainstWorld missiles could pass through the medistation on their initial trace. This was caused by an incorrect comparison to decide if the CONTENTS_SOLID or CONTENTS_BODY trace went further. Probably a regression in ab59025
|
This doesn't fix the issue on my end (tested with blaster and prifle, dll sgame). |
Really? I tested the branch again and can't reproduce the issue with either weapon. |
|
Yeah, I get this result: https://users.unvanquished.net/~reaper/test2.mp4 |
| } | ||
| else | ||
| { | ||
| trace2_t trBody = G_Trace2(ent->r.currentOrigin, ent->r.mins, ent->r.maxs, trWorld.endpos, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first trace goes the entire length from ent->r.currentOrigin to origin. The second trace goes only up to trWorld.endpos, making it shorter in the bugged case. Thus the two trace fractions can't be directly compared and the ternary below is broken.
Changing the endpoint of this trace to origin fixes the issue.
What is the purpose of pointAgainstWorld in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the endpoint of this trace to
originfixes the issue.
Sure, making both traces use the same endpoint would be another way to fix it.
What is the purpose of
pointAgainstWorldin the first place?
It makes the missile use a point trace against map geometry (CONTENTS_SOLID) but a finite sized box trace against CONTENTS_BODY entities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes the missile use a point trace against map geometry (CONTENTS_SOLID) but a finite sized box trace against CONTENTS_BODY entities.
Oh, that makes sense, thanks.
Sure, making both traces use the same endpoint would be another way to fix it.
It's the fix. Comparing fractions from completely different traces doesn't make any sense. Your code is still bugged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the proposed change there is no longer a comparison of two fractions. Only the comparison of a fraction with 1.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, my bad.
I tested your branch (rebased on top of v0.55.3) and everything works fine. I can't reproduce Reaper's issue. I tried both DLL and nexe.
See #3275