Browse Source

Fix trace initialization in PM_TraceModel usage. Related issue: https://github.com/ValveSoftware/halflife/issues/3283 (#287)

fix-cwd-path
Roman Chistokhodov 2 years ago committed by GitHub
parent
commit
4e7d64180b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      pm_shared/pm_shared.c

16
pm_shared/pm_shared.c

@ -120,6 +120,20 @@ static char grgchTextureType[CTEXTURESMAX]; @@ -120,6 +120,20 @@ static char grgchTextureType[CTEXTURESMAX];
int g_onladder = 0;
static inline void PM_InitTrace( trace_t *trace, const vec3_t end )
{
memset( trace, 0, sizeof( *trace ));
VectorCopy( end, trace->endpos );
trace->allsolid = true;
trace->fraction = 1.0f;
}
static void PM_TraceModel( physent_t *pe, float *start, float *end, trace_t *trace )
{
PM_InitTrace( trace, end );
pmove->PM_TraceModel(pe, start, end, trace);
}
void PM_SwapTextures( int i, int j )
{
char chTemp;
@ -2108,7 +2122,7 @@ void PM_LadderMove( physent_t *pLadder ) @@ -2108,7 +2122,7 @@ void PM_LadderMove( physent_t *pLadder )
onFloor = false;
pmove->gravity = 0;
pmove->PM_TraceModel( pLadder, pmove->origin, ladderCenter, &trace );
PM_TraceModel(pLadder, pmove->origin, ladderCenter, &trace);
if( trace.fraction != 1.0f )
{
float forward = 0, right = 0;

Loading…
Cancel
Save