}
else
{
- float distance = vlen(self.origin - other.origin);
- float f = (distance + 100.0) * autocvar_cl_playerdetailreduction;
+ float distance = vlen(self.origin - view_origin);
+ float f = (distance * current_viewzoom + 100.0) * autocvar_cl_playerdetailreduction;
f *= 1.0 / bound(0.01, view_quality, 1);
if(f > autocvar_cl_loddistance2)
self.modelindex = self.lodmodelindex2;
{
entity e;
e = spawn();
+ precache_model(cvar_defstring("_cl_playermodel"));
setmodel(e, cvar_defstring("_cl_playermodel"));
forceplayermodels_goodmodel = e.model;
forceplayermodels_goodmodelindex = e.modelindex;
.float csqcmodel_saveframe4;
.float csqcmodel_framecount;
-.float csqcmodel_isdead; // for utility code
-
#define IS_DEAD_FRAME(f) ((f) == 0 || (f) == 1)
void CSQCPlayer_FallbackFrame_PreUpdate(void)
{
if(isnew)
{
#define FIX_FRAMETIME(f,ft) \
- if(IS_DEAD_FRAME(self.f)) \
+ if(IS_DEAD_FRAME(self.f) && self.ft != 0 && self.death_time != 0) \
{ \
self.ft = self.death_time; \
}
{
if(frameduration(self.modelindex, f) > 0)
return f; // goooooood
+ if(frameduration(self.modelindex, 1) <= 0)
+ return f; // this is a static model. We can't fix it if we wanted to
switch(f)
{
case 23: return 11; // anim_melee -> anim_shoot
{
self.glowmod = self.glowmod * bound(0, 1 - (time - self.death_time) / autocvar_cl_deathglow, 1);
// prevent the zero vector
- if(self.glowmod_x == 0)
- self.glowmod_x = -1;
+ self.glowmod_x = max(self.glowmod_x, 0.0001);
+ self.glowmod_y = max(self.glowmod_y, 0.0001);
+ self.glowmod_z = max(self.glowmod_z, 0.0001);
}
}