engine: share playermove ClearPhysEnts function

This commit is contained in:
Alibek Omarov 2023-01-06 00:14:49 +03:00
parent 0bec78a958
commit 787d3bc5dd
9 changed files with 14 additions and 28 deletions

View File

@ -2458,7 +2458,6 @@ pfnSetTraceHull
void GAME_EXPORT CL_SetTraceHull( int hull )
{
clgame.pmove->usehull = bound( 0, hull, 3 );
}
/*

View File

@ -22,6 +22,7 @@ GNU General Public License for more details.
#include "vgui_draw.h"
#include "library.h"
#include "vid_common.h"
#include "pm_local.h"
#define MAX_TOTAL_CMDS 32
#define MAX_CMD_BUFFER 8000
@ -1380,7 +1381,7 @@ void CL_ClearState( void )
CL_ClearEffects ();
CL_FreeEdicts ();
CL_ClearPhysEnts ();
PM_ClearPhysEnts( clgame.pmove );
NetAPI_CancelAllRequests();
// wipe the entire cl structure

View File

@ -26,20 +26,6 @@ GNU General Public License for more details.
#define MIN_PREDICTION_EPSILON 0.5f // complain if error is > this and we have cl_showerror set
#define MAX_PREDICTION_ERROR 64.0f // above this is assumed to be a teleport, don't smooth, etc.
/*
=============
CL_ClearPhysEnts
=============
*/
void CL_ClearPhysEnts( void )
{
clgame.pmove->numtouch = 0;
clgame.pmove->numvisent = 0;
clgame.pmove->nummoveent = 0;
clgame.pmove->numphysent = 0;
}
/*
=============
CL_PushPMStates
@ -807,7 +793,7 @@ void CL_InitClientMove( void )
clgame.pmove->Con_Printf = Con_Printf;
clgame.pmove->Sys_FloatTime = Sys_DoubleTime;
clgame.pmove->PM_StuckTouch = pfnStuckTouch;
clgame.pmove->PM_PointContents = PM_CL_PointContents;
clgame.pmove->PM_PointContents = (void*)PM_CL_PointContents;
clgame.pmove->PM_TruePointContents = pfnTruePointContents;
clgame.pmove->PM_HullPointContents = pfnHullPointContents;
clgame.pmove->PM_PlayerTrace = pfnPlayerTrace;

View File

@ -926,7 +926,6 @@ void CL_PopTraceBounds( void );
void CL_MoveSpectatorCamera( void );
void CL_SetLastUpdate( void );
void CL_RedoPrediction( void );
void CL_ClearPhysEnts( void );
void CL_PushPMStates( void );
void CL_PopPMStates( void );
void CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient );

View File

@ -30,6 +30,7 @@ void PM_DrawBBox( const vec3_t mins, const vec3_t maxs, const vec3_t origin, int
// pm_trace.c
//
void Pmove_Init( void );
void PM_ClearPhysEnts( playermove_t *pmove );
void PM_InitBoxHull( void );
hull_t *PM_HullForBsp( physent_t *pe, playermove_t *pmove, float *offset );
qboolean PM_RecursiveHullCheck( hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, pmtrace_t *trace );

View File

@ -55,6 +55,14 @@ void Pmove_Init( void )
memcpy( host.player_maxs, pm_hullmaxs, sizeof( pm_hullmaxs ));
}
void PM_ClearPhysEnts( playermove_t *pmove )
{
pmove->nummoveent = 0;
pmove->numphysent = 0;
pmove->numvisent = 0;
pmove->numtouch = 0;
}
/*
===================
PM_InitBoxHull

View File

@ -697,6 +697,5 @@ void SV_RunLightStyles( void );
void SV_SetLightStyle( int style, const char* s, float f );
const char *SV_GetLightStyle( int style );
int SV_LightForEntity( edict_t *pEdict );
void SV_ClearPhysEnts( void );
#endif//SERVER_H

View File

@ -18,6 +18,7 @@ GNU General Public License for more details.
#include "net_encode.h"
#include "library.h"
#include "voice.h"
#include "pm_local.h"
#if XASH_LOW_MEMORY != 2
int SV_UPDATE_BACKUP = SINGLEPLAYER_BACKUP;
@ -651,7 +652,7 @@ void SV_DeactivateServer( void )
SV_FreeEdicts ();
SV_ClearPhysEnts ();
PM_ClearPhysEnts( svgame.pmove );
SV_EmptyStringPool();

View File

@ -22,14 +22,6 @@ GNU General Public License for more details.
static qboolean has_update = false;
void SV_ClearPhysEnts( void )
{
svgame.pmove->numtouch = 0;
svgame.pmove->numvisent = 0;
svgame.pmove->nummoveent = 0;
svgame.pmove->numphysent = 0;
}
qboolean SV_PlayerIsFrozen( edict_t *pClient )
{
if( sv_background_freeze.value && sv.background )