mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-11 15:38:12 +00:00
Fix trace initialization in PM_TraceModel usage. Related issue: https://github.com/ValveSoftware/halflife/issues/3283 (#287)
This commit is contained in:
parent
0207817bf4
commit
4e7d64180b
@ -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 )
|
||||
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…
Reference in New Issue
Block a user