Also save the valid ground trace when stepping
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 45s

This commit is contained in:
smallmodel 2025-01-20 22:22:24 +01:00
parent 599914934c
commit 24c7311162
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -365,6 +365,7 @@ void MM_StepSlideMove(void)
vec3_t start_hit_origin;
vec3_t first_hit_origin;
trace_t nostep_groundTrace;
qboolean nostep_validGroundTrace;
VectorCopy(mm->origin, start_o);
VectorCopy(mm->velocity, start_v);
@ -410,6 +411,9 @@ void MM_StepSlideMove(void)
VectorCopy(mm->origin, nostep_o);
VectorCopy(mm->velocity, nostep_v);
memcpy(&nostep_groundTrace, &mml.groundTrace, sizeof(trace_t));
// Fixed in OPM
// Save the valid ground trace
nostep_validGroundTrace = mml.validGroundTrace;
VectorCopy(up, mm->origin);
VectorCopy(start_v, mm->velocity);
@ -432,6 +436,10 @@ void MM_StepSlideMove(void)
VectorCopy(nostep_o, mm->origin);
VectorCopy(nostep_v, mm->velocity);
memcpy(&mml.groundTrace, &nostep_groundTrace, sizeof(mml.groundTrace));
// Fixed in OPM
// Do not use the ground trace as it's invalid and would have an invalid entity number
mml.validGroundTrace = nostep_validGroundTrace;
mm->hit_obstacle = first_hit_wall;
VectorCopy(first_hit_origin, mm->hit_origin);
VectorCopy(first_wall_normal, mm->obstacle_normal);