string modelname = self.model;
string s;
+ vector mi = self.mins;
+ vector ma = self.maxs;
+
// set modelindex
self.lodmodelindex0 = self.modelindex;
self.lodmodelindex1 = self.modelindex;
}
setmodel(self, modelname); // make everything normal again
+ setsize(self, mi, ma);
}
// apply LOD
}
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;
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
}
// recursive predraw call to fix issues with forcemodels and LOD if bone indexes mismatch
+ if(self.tag_entity.classname == "csqcmodel")
{
entity oldself = self;
self = self.tag_entity;
{
// the best part is: IT EXISTS
if(substring(self.model, 0, 17) == "models/weapons/v_")
+ {
if(substring(self.tag_entity.model, 0, 17) == "models/weapons/h_")
{
self.tag_index = gettagindex(self.tag_entity, "weapon");
dprint("h_ model lacks weapon attachment, but v_ model is attached to it\n");
}
}
-
- if(substring(self.model, 0, 17) == "models/weapons/v_")
- if(substring(self.tag_entity.model, 0, 14) == "models/player/")
+ else if(self.tag_entity.isplayermodel)
{
- self.tag_index = gettagindex(self.tag_entity, "tag_weapon");
+ self.tag_index = gettagindex(self.tag_entity, "weapon");
+ if(!self.tag_index)
+ self.tag_index = gettagindex(self.tag_entity, "tag_weapon");
if(!self.tag_index)
self.tag_index = gettagindex(self.tag_entity, "bip01 r hand");
}
+ }
if(substring(self.tag_entity.model, 0, 17) == "models/weapons/v_")
{
void CSQCModel_Hook_PostUpdate(float isnew, float isplayer, float islocalplayer)
{
// is it a player model? (shared state)
- self.isplayermodel = (substring(self.model, 0, 14) == "models/player/");
+ self.isplayermodel = (substring(self.model, 0, 14) == "models/player/" || substring(self.model, 0, 17) == "models/ok_player/");
// save values set by server
if(self.isplayermodel)