diff --git a/engine/client/cl_ents.c b/engine/client/cl_ents.c index af7155374..e2b378fa4 100644 --- a/engine/client/cl_ents.c +++ b/engine/client/cl_ents.c @@ -32,6 +32,8 @@ extern cvar_t r_rocketlight; extern cvar_t r_lightflicker; extern cvar_t cl_r2g; extern cvar_t r_powerupglow; + +extern cvar_t cl_gibfilter, cl_deadbodyfilter; extern int cl_playerindex; static struct predicted_player { @@ -51,7 +53,32 @@ static struct predicted_player { float newlerprate; -extern int cl_rocketindex, cl_grenadeindex; +extern int cl_playerindex, cl_h_playerindex, cl_rocketindex, cl_grenadeindex, cl_gib1index, cl_gib2index, cl_gib3index; + +qboolean CL_FilterModelindex(int modelindex, int frame) +{ + if (modelindex == cl_playerindex) + { + if (cl_deadbodyfilter.value == 2) + { + if (frame >= 41 && frame <= 102) + return true; + } + else if (cl_deadbodyfilter.value) + { + if (frame == 49 || frame == 60 || frame == 69 || frame == 84 || frame == 93 || frame == 102) + return true; + } + } + + if (cl_gibfilter.value && ( + modelindex == cl_h_playerindex || + modelindex == cl_gib1index || + modelindex == cl_gib2index || + modelindex == cl_gib3index)) + return true; + return false; +} //============================================================ @@ -1284,6 +1311,9 @@ void CL_LinkPacketEntities (void) if (cl_numvisedicts == MAX_VISEDICTS) break; // object list is full + if (CL_FilterModelindex(s1->modelindex, s1->frame)) + continue; + model = cl.model_precache[s1->modelindex]; if (!model) { @@ -2050,6 +2080,9 @@ void CL_LinkPlayers (void) if (state->modelindex < 1) continue; + + if (CL_FilterModelindex(state->modelindex, state->frame)) + continue; /* if (!Cam_DrawPlayer(j)) continue; diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 279fa668b..9abbe546f 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -111,6 +111,8 @@ cvar_t r_rocketlight = {"r_rocketlight", "1"}; cvar_t r_lightflicker = {"r_lightflicker", "1"}; cvar_t cl_r2g = {"cl_r2g", "0"}; cvar_t r_powerupglow = {"r_powerupglow", "1"}; +cvar_t cl_gibfilter = {"cl_gibfilter", "0"}; +cvar_t cl_deadbodyfilter = {"cl_deadbodyfilter", "0"}; cvar_t cl_muzzleflash = {"cl_muzzleflash", "1"}; @@ -2279,6 +2281,9 @@ void CL_Init (void) Cvar_Register (&cl_r2g, "Item effects"); Cvar_Register (&r_powerupglow, "Item effects"); + Cvar_Register (&cl_gibfilter, "Item effects"); + Cvar_Register (&cl_deadbodyfilter, "Item effects"); + // // info mirrors // diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 7b787aa49..cee277774 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -467,7 +467,7 @@ int oldparsecountmod; int parsecountmod; double parsecounttime; -int cl_spikeindex, cl_playerindex, cl_flagindex, cl_rocketindex, cl_grenadeindex; +int cl_spikeindex, cl_playerindex, cl_h_playerindex, cl_flagindex, cl_rocketindex, cl_grenadeindex, cl_gib1index, cl_gib2index, cl_gib3index; #ifdef PEXT_LIGHTUPDATES int cl_lightningindex; @@ -919,10 +919,14 @@ void Sound_NextDownload (void) // done with sounds, request models now memset (cl.model_precache, 0, sizeof(cl.model_precache)); cl_playerindex = -1; + cl_h_playerindex = -1; cl_spikeindex = -1; cl_flagindex = -1; cl_rocketindex = -1; cl_grenadeindex = -1; + cl_gib1index = -1; + cl_gib2index = -1; + cl_gib3index = -1; #ifdef PEXT_LIGHTUPDATES cl_lightningindex = -1; #endif @@ -2098,6 +2102,8 @@ void CL_ParseModellist (qboolean lots) #endif if (!strcmp(cl.model_name[nummodels],"progs/player.mdl")) cl_playerindex = nummodels; + if (!strcmp(cl.model_name[nummodels],"progs/h_player.mdl")) + cl_h_playerindex = nummodels; if (!strcmp(cl.model_name[nummodels],"progs/flag.mdl")) cl_flagindex = nummodels; @@ -2105,6 +2111,14 @@ void CL_ParseModellist (qboolean lots) cl_rocketindex = nummodels; if (!strcmp(cl.model_name[nummodels],"progs/grenade.mdl")) cl_grenadeindex = nummodels; + + + if (!strcmp(cl.model_name[nummodels],"progs/gib1.mdl")) + cl_gib1index = nummodels; + if (!strcmp(cl.model_name[nummodels],"progs/gib2.mdl")) + cl_gib2index = nummodels; + if (!strcmp(cl.model_name[nummodels],"progs/gib3.mdl")) + cl_gib3index = nummodels; } if (nummodels)