-
+.float isplayermodel;
// FEATURE: LOD
.float lodmodelindex0;
self.frame3 = self.csqcmodel_saveframe3;
self.frame4 = self.csqcmodel_saveframe4;
}
-void CSQCPlayer_FallbackFrame_PostUpdate(void)
+void CSQCPlayer_FallbackFrame_PostUpdate(float isnew)
{
self.csqcmodel_saveframe = self.frame;
self.csqcmodel_saveframe2 = self.frame2;
self.csqcmodel_saveframe3 = self.frame3;
self.csqcmodel_saveframe4 = self.frame4;
+
+ // hack for death animations: set their frametime to zero in case a
+ // player "pops in"
+ if(isnew)
+ {
+#define FIX_FRAMETIME(f,ft) \
+ switch(self.f) \
+ { \
+ case 0: // anim_die1 \
+ case 1: // anim_die2 \
+ self.ft = 0; \
+ break; \
+ }
+ FIX_FRAMETIME(frame, frame1time);
+ FIX_FRAMETIME(frame2, frame2time);
+ FIX_FRAMETIME(frame3, frame3time);
+ FIX_FRAMETIME(frame4, frame4time);
+ }
}
float CSQCPlayer_FallbackFrame(float f)
{
else
self.drawmask = MASK_NORMAL;
- if(isplayer)
+ if(self.isplayermodel) // this checks if it's a player MODEL!
{
CSQCPlayer_GlowMod_Apply();
CSQCPlayer_ForceModel_Apply(islocalplayer);
CSQCPlayer_FallbackFrame_Apply();
}
- if(!isplayer)
+ if(!isplayer) // this checks if it's a player SLOT!
CSQCModel_AutoTagIndex_Apply();
CSQCModel_Effects_Apply();
}
-void CSQCModel_Hook_PreUpdate(float isplayer, float islocalplayer)
+void CSQCModel_Hook_PreUpdate(float isnew, float isplayer, float islocalplayer)
{
+ // revert to values from server
CSQCModel_Effects_PreUpdate();
- if(isplayer)
+ if(self.isplayermodel)
{
- // revert to values from server
CSQCPlayer_FallbackFrame_PreUpdate();
CSQCPlayer_ForceModel_PreUpdate();
}
}
-void CSQCModel_Hook_PostUpdate(float isplayer, float islocalplayer)
+void CSQCModel_Hook_PostUpdate(float isnew, float isplayer, float islocalplayer)
{
- if(isplayer)
+ // is it a player model? (shared state)
+ self.isplayermodel = (substring(self.model, 0, 14) == "models/player/");
+
+ // save values set by server
+ if(self.isplayermodel)
{
- // save values set by server
CSQCPlayer_ForceModel_PostUpdate();
- CSQCPlayer_FallbackFrame_PostUpdate();
+ CSQCPlayer_FallbackFrame_PostUpdate(isnew);
}
CSQCModel_Effects_PostUpdate();
}
self.pauseregen_finished = 0;
self.damageforcescale = 0;
self.death_time = 0;
- self.dead_frame = 0;
self.alpha = 0;
self.scale = 0;
self.fade_time = 0;
}
self.damageforcescale = 2;
self.death_time = 0;
- self.dead_frame = 0;
self.alpha = 0;
self.scale = 0;
self.fade_time = 0;
self.animstate_override = oldself.animstate_override;
self.animstate_looping = oldself.animstate_looping;
self.frame = oldself.frame;
- self.dead_frame = oldself.dead_frame;
self.pain_finished = oldself.pain_finished;
self.health = oldself.health;
self.armorvalue = oldself.armorvalue;
self.anim_runbackwards = animfixfps(self, '14 1 1');
self.anim_strafeleft = animfixfps(self, '15 1 1');
self.anim_straferight = animfixfps(self, '16 1 1');
- self.anim_dead1 = animfixfps(self, '17 1 1');
- self.anim_dead2 = animfixfps(self, '18 1 1');
+ //self.anim_dead1 = animfixfps(self, '17 1 1');
+ //self.anim_dead2 = animfixfps(self, '18 1 1');
self.anim_forwardright = animfixfps(self, '19 1 1');
self.anim_forwardleft = animfixfps(self, '20 1 1');
self.anim_backright = animfixfps(self, '21 1 1');
updateanim(self.weaponentity);
if (self.deadflag != DEAD_NO)
- {
- if (time > self.animstate_endtime)
- {
- if (self.maxs_z > 5)
- {
- self.maxs_z = 5;
- setsize(self, self.mins, self.maxs);
- }
- self.frame = self.dead_frame;
- }
return;
- }
if (!self.animstate_override)
{
{
// don't use any animations as a gib
self.frame = 0;
- self.dead_frame = 0;
// view just above the floor
self.view_ofs = '0 0 4';
else
self.respawn_countdown = -1; // do not count down
if (random() < 0.5)
- {
setanim(self, self.anim_die1, FALSE, TRUE, TRUE);
- self.dead_frame = self.anim_dead1_x;
- }
else
- {
setanim(self, self.anim_die2, FALSE, TRUE, TRUE);
- self.dead_frame = self.anim_dead2_x;
+ if (self.maxs_z > 5)
+ {
+ self.maxs_z = 5;
+ setsize(self, self.mins, self.maxs);
}
// set damage function to corpse damage
self.event_damage = PlayerCorpseDamage;
.float play_time;
.float death_time;
-.float dead_frame;
.float fade_time;
.float fade_rate;
.vector anim_runbackwards; // player running backward
.vector anim_strafeleft; // player shuffling left quickly
.vector anim_straferight; // player shuffling right quickly
-.vector anim_dead1; // player dead (must be identical to last frame of die1)
-.vector anim_dead2; // player dead (must be identical to last frame of die2)
+//.vector anim_dead1; // player dead (must be identical to last frame of die1)
+//.vector anim_dead2; // player dead (must be identical to last frame of die2)
.vector anim_forwardright; // player running forward and right
.vector anim_forwardleft; // player running forward and left
.vector anim_backright; // player running backward and right