-/*
-=============
-Client_customizeentityforclient
-
-LOD reduction
-=============
-*/
-void Client_uncustomizeentityforclient()
-{
- if(self.modelindex == 0) // no need to uncustomize then
- return;
- self.modelindex = self.modelindex_lod0;
- self.skin = self.skinindex;
-}
-
-float Client_customizeentityforclient()
-{
- entity modelsource;
-
- if(self.modelindex == 0)
- return TRUE;
-
- // forcemodel stuff
-
-#ifdef PROFILING
- float t0;
- t0 = gettime(GETTIME_HIRES); // reference
-#endif
-
- modelsource = self;
-
-#ifdef ALLOW_FORCEMODELS
- if(other.cvar_cl_forceplayermodelsfromxonotic)
- if not(self.modelindex_lod0_from_xonotic)
- modelsource = other;
- if(other.cvar_cl_forceplayermodels && sv_clforceplayermodels)
- modelsource = other;
-#endif
-
- self.skin = modelsource.skinindex;
-
-#if 0
- if(modelsource == self)
- self.skin = modelsource.skinindex;
- else
- self.skin = mod(modelsource.skinindex, 3); // forbid the fbskins as forced skins
-#endif
-
- // self: me
- // other: the player viewing me
- float distance;
- float f;
-
- if(other.cvar_cl_playerdetailreduction <= 0)
- {
- if(other.cvar_cl_playerdetailreduction <= -2)
- self.modelindex = modelsource.modelindex_lod2;
- else if(other.cvar_cl_playerdetailreduction <= -1)
- self.modelindex = modelsource.modelindex_lod1;
- else
- self.modelindex = modelsource.modelindex_lod0;
- }
- else
- {
- distance = vlen(self.origin - other.origin);
- f = (distance + 100.0) * other.cvar_cl_playerdetailreduction;
- if(f > sv_loddistance2)
- self.modelindex = modelsource.modelindex_lod2;
- else if(f > sv_loddistance1)
- self.modelindex = modelsource.modelindex_lod1;
- else
- self.modelindex = modelsource.modelindex_lod0;
- }
-
-#ifdef PROFILING
- float t1;
- t1 = gettime(GETTIME_HIRES); // reference
- client_cefc_accumulator += (t1 - t0);
-#endif
-
- return TRUE;
-}
-
-void setmodel_lod(entity e, string modelname)