Continue traveling if the bullet trace goes backwards

This commit is contained in:
smallmodel 2024-11-10 18:34:33 +01:00
parent c5721f8a2c
commit fcc4e94655
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -2207,6 +2207,8 @@ float BulletAttack(
oldfrac = -1;
while (trace.fraction < 1.0f) {
Vector vDeltaTrace;
trace = G_Trace(
vTraceStart, vec_zero, vec_zero, vTraceEnd, newowner, MASK_SHOT_TRIG, false, "BulletAttack", true
);
@ -2452,6 +2454,13 @@ float BulletAttack(
} else {
trace.fraction = 1;
}
vDeltaTrace = vTmpEnd - vTraceStart;
if (!bBulletDone && DotProduct(vDeltaTrace, vDir) < 0) {
// Fixed in OPM
// This can happen in rare circumstances if the trace is out of the world limit
break;
}
}
}