1 #include "csqcmodel_hooks.qh"
2 #include "mutators/events.qh"
3 #include "player_skeleton.qh"
4 #include "weapons/projectile.qh"
5 #include <common/animdecide.qh>
6 #include <common/ent_cs.qh>
7 #include <common/physics/movetypes/movetypes.qh>
8 #include <common/viewloc.qh>
9 #include <lib/csqcmodel/cl_model.qh>
10 #include <lib/csqcmodel/cl_player.qh>
11 #include <lib/csqcmodel/interpolate.qh>
16 void CSQCModel_Hook_PreDraw(entity this, bool isplayer);
24 void CSQCPlayer_LOD_Apply(entity this)
27 if(this.lodmodelindex0 != this.modelindex)
29 string modelname = this.model;
32 vector mi = this.mins;
33 vector ma = this.maxs;
36 this.lodmodelindex0 = this.modelindex;
37 this.lodmodelindex1 = this.modelindex;
38 this.lodmodelindex2 = this.modelindex;
40 // FIXME: this only supports 3-letter extensions
41 s = strcat(substring(modelname, 0, strlen(modelname)-4), "_lod1", substring(modelname, -4, 4));
47 this.lodmodelindex1 = this.modelindex;
50 s = strcat(substring(modelname, 0, strlen(modelname)-4), "_lod2", substring(modelname, -4, 4));
56 this.lodmodelindex2 = this.modelindex;
59 _setmodel(this, modelname); // make everything normal again
60 setsize(this, mi, ma);
64 if(autocvar_cl_playerdetailreduction <= 0)
66 if(autocvar_cl_playerdetailreduction <= -2)
67 this.modelindex = this.lodmodelindex2;
68 else if(autocvar_cl_playerdetailreduction <= -1)
69 this.modelindex = this.lodmodelindex1;
71 this.modelindex = this.lodmodelindex0;
75 float distance = vlen(this.origin - view_origin);
76 float f = (distance * current_viewzoom + 100.0) * autocvar_cl_playerdetailreduction;
77 f *= 1.0 / bound(0.01, view_quality, 1);
78 if(f > autocvar_cl_loddistance2)
79 this.modelindex = this.lodmodelindex2;
80 else if(f > autocvar_cl_loddistance1)
81 this.modelindex = this.lodmodelindex1;
83 this.modelindex = this.lodmodelindex0;
87 // FEATURE: forcemodel and model color selection (MUST be called BEFORE LOD!)
88 string forceplayermodels_model;
89 bool forceplayermodels_modelisgoodmodel;
90 int forceplayermodels_modelindex;
91 int forceplayermodels_skin;
93 string forceplayermodels_mymodel;
94 bool forceplayermodels_myisgoodmodel;
95 int forceplayermodels_mymodelindex;
97 bool forceplayermodels_attempted;
99 .string forceplayermodels_savemodel;
100 .int forceplayermodels_savemodelindex;
101 .int forceplayermodels_saveskin;
102 .int forceplayermodels_savecolormap;
104 .string forceplayermodels_isgoodmodel_mdl;
105 .bool forceplayermodels_isgoodmodel;
107 string forceplayermodels_goodmodel;
108 int forceplayermodels_goodmodelindex;
113 void CSQCPlayer_ModelAppearance_PreUpdate(entity this)
115 this.model = this.forceplayermodels_savemodel;
116 this.modelindex = this.forceplayermodels_savemodelindex;
117 this.skin = this.forceplayermodels_saveskin;
118 this.colormap = this.forceplayermodels_savecolormap;
120 void CSQCPlayer_ModelAppearance_PostUpdate(entity this)
122 this.forceplayermodels_savemodel = this.model;
123 this.forceplayermodels_savemodelindex = this.modelindex;
124 this.forceplayermodels_saveskin = this.skin;
125 this.forceplayermodels_savecolormap = this.colormap;
127 if(this.forceplayermodels_savemodel != this.forceplayermodels_isgoodmodel_mdl)
129 this.forceplayermodels_isgoodmodel = fexists(this.forceplayermodels_savemodel);
130 this.forceplayermodels_isgoodmodel_mdl = this.forceplayermodels_savemodel;
131 if(!this.forceplayermodels_isgoodmodel)
132 LOG_INFOF("Warning: missing model %s has been used\n", this.forceplayermodels_savemodel);
135 void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
138 // which one is ALWAYS good?
139 if (!forceplayermodels_goodmodel)
142 precache_model(cvar_defstring("_cl_playermodel"));
143 _setmodel(e, cvar_defstring("_cl_playermodel"));
144 forceplayermodels_goodmodel = e.model;
145 forceplayermodels_goodmodelindex = e.modelindex;
149 // first, try finding it from the server
150 if(this.forceplayermodels_savemodelindex && this.forceplayermodels_savemodel != "null")
154 if(!isdemo()) // this is mainly cheat protection; not needed for demos
156 // trust server's idea of "own player model"
157 forceplayermodels_modelisgoodmodel = this.forceplayermodels_isgoodmodel;
158 forceplayermodels_model = this.forceplayermodels_savemodel;
159 forceplayermodels_modelindex = this.forceplayermodels_savemodelindex;
160 forceplayermodels_skin = this.forceplayermodels_saveskin;
161 forceplayermodels_attempted = 1;
166 // forcemodel finding
167 if(!forceplayermodels_attempted)
169 forceplayermodels_attempted = 1;
171 // only if this failed, find it out on our own
173 precache_model(autocvar__cl_playermodel);
174 _setmodel(e, autocvar__cl_playermodel); // this is harmless, see below
175 forceplayermodels_modelisgoodmodel = fexists(e.model);
176 forceplayermodels_model = e.model;
177 forceplayermodels_modelindex = e.modelindex;
178 forceplayermodels_skin = autocvar__cl_playerskin;
182 if(autocvar_cl_forcemyplayermodel != "" && autocvar_cl_forcemyplayermodel != forceplayermodels_mymodel)
185 _setmodel(e, autocvar_cl_forcemyplayermodel); // this is harmless, see below
186 forceplayermodels_myisgoodmodel = fexists(e.model);
187 forceplayermodels_mymodel = e.model;
188 forceplayermodels_mymodelindex = e.modelindex;
195 cm = this.forceplayermodels_savecolormap;
196 cm = (cm >= 1024) ? cm : (entcs_GetClientColors(cm - 1) + 1024);
199 isfriend = (cm == 1024 + 17 * myteam);
201 isfriend = islocalplayer;
203 if(autocvar_cl_forcemyplayermodel != "" && forceplayermodels_myisgoodmodel && isfriend)
205 this.model = forceplayermodels_mymodel;
206 this.modelindex = forceplayermodels_mymodelindex;
207 this.skin = autocvar_cl_forcemyplayerskin;
209 else if(autocvar_cl_forceplayermodels && forceplayermodels_modelisgoodmodel)
211 this.model = forceplayermodels_model;
212 this.modelindex = forceplayermodels_modelindex;
213 this.skin = forceplayermodels_skin;
215 else if(this.forceplayermodels_isgoodmodel)
217 this.model = this.forceplayermodels_savemodel;
218 this.modelindex = this.forceplayermodels_savemodelindex;
219 this.skin = this.forceplayermodels_saveskin;
223 this.model = forceplayermodels_goodmodel;
224 this.modelindex = forceplayermodels_goodmodelindex;
225 this.skin = this.forceplayermodels_saveskin;
228 // forceplayercolors too
231 // own team's color is never forced
232 int forcecolor_friend = 0;
233 int forcecolor_enemy = 0;
236 if(autocvar_cl_forcemyplayercolors)
237 forcecolor_friend = 1024 + autocvar_cl_forcemyplayercolors;
238 if(autocvar_cl_forceplayercolors == 2 && team_count == 2)
239 forcecolor_enemy = 1024 + autocvar__cl_color;
241 if(forcecolor_enemy && !forcecolor_friend)
243 // only enemy color is forced?
244 // verify it is not equal to the friend color
245 if(forcecolor_enemy == 1024 + 17 * myteam)
246 forcecolor_enemy = 0;
249 if(forcecolor_friend && !forcecolor_enemy)
251 // only friend color is forced?
252 // verify it is not equal to the enemy color
253 for(tm = teams.sort_next; tm; tm = tm.sort_next)
254 // note: we even compare against our own team.
255 // if we rejected because we matched our OWN team color,
256 // this is not bad; we then simply keep our color as is
258 if(forcecolor_friend == 1024 + 17 * tm.team)
259 forcecolor_friend = 0;
262 if(cm == 1024 + 17 * myteam)
264 if(forcecolor_friend)
265 this.colormap = forcecolor_friend;
270 this.colormap = forcecolor_enemy;
275 if(autocvar_cl_forcemyplayercolors && islocalplayer)
276 this.colormap = 1024 + autocvar_cl_forcemyplayercolors;
277 else if(autocvar_cl_forceplayercolors)
278 this.colormap = player_localnum + 1;
281 // GLOWMOD AND DEATH FADING
282 if(this.colormap > 0)
283 this.glowmod = colormapPaletteColor(((this.colormap >= 1024) ? this.colormap : entcs_GetClientColors(this.colormap - 1)) & 0x0F, true) * 2;
285 this.glowmod = '1 1 1';
287 if(autocvar_cl_deathglow > 0)
289 if(this.csqcmodel_isdead)
291 // Fade out to black now...
292 if(this.old_glowmod == '0 0 0') { this.old_glowmod = this.glowmod; }
295 this.glowmod = this.old_glowmod * bound(0, 1 - (time - this.death_time) / autocvar_cl_deathglow, 1);
296 this.glowmod_x = max(this.glowmod.x, 0.0001);
297 this.glowmod_y = max(this.glowmod.y, 0.0001);
298 this.glowmod_z = max(this.glowmod.z, 0.0001);
300 else if(this.old_glowmod != '0 0 0') { this.old_glowmod = '0 0 0'; }
303 //printf("CSQCPlayer_ModelAppearance_Apply(): state = %s, colormap = %f, glowmod = %s\n", (this.csqcmodel_isdead ? "DEAD" : "ALIVE"), this.colormap, vtos(this.glowmod));
306 // FEATURE: fallback frames
307 .int csqcmodel_saveframe;
308 .int csqcmodel_saveframe2;
309 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
310 .int csqcmodel_saveframe3;
311 .int csqcmodel_saveframe4;
313 .int csqcmodel_framecount;
315 #define IS_DEAD_FRAME(f) ((f) == 0 || (f) == 1)
316 void CSQCPlayer_FallbackFrame_PreUpdate(entity this)
318 this.frame = this.csqcmodel_saveframe;
319 this.frame2 = this.csqcmodel_saveframe2;
320 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
321 this.frame3 = this.csqcmodel_saveframe3;
322 this.frame4 = this.csqcmodel_saveframe4;
325 void CSQCPlayer_FallbackFrame_PostUpdate(entity this, bool isnew)
327 this.csqcmodel_saveframe = this.frame;
328 this.csqcmodel_saveframe2 = this.frame2;
329 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
330 this.csqcmodel_saveframe3 = this.frame3;
331 this.csqcmodel_saveframe4 = this.frame4;
334 // hack for death animations: set their frametime to zero in case a
338 #define FIX_FRAMETIME(f,ft) MACRO_BEGIN { \
339 if(IS_DEAD_FRAME(this.f) && this.ft != 0 && this.death_time != 0) \
340 this.ft = this.death_time; \
342 FIX_FRAMETIME(frame, frame1time);
343 FIX_FRAMETIME(frame2, frame2time);
344 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
345 FIX_FRAMETIME(frame3, frame3time);
346 FIX_FRAMETIME(frame4, frame4time);
349 this.csqcmodel_isdead = IS_DEAD_FRAME(this.frame);
351 void CSQCPlayer_AnimDecide_PostUpdate(entity this, bool isnew)
353 this.csqcmodel_isdead = boolean(this.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
355 int CSQCPlayer_FallbackFrame(entity this, int f)
358 if(frameduration(this.modelindex, f) > 0)
359 return f; // goooooood
360 if(frameduration(this.modelindex, 1) <= 0)
361 return f; // this is a static model. We can't fix it if we wanted to
364 case 23: return 11; // anim_melee -> anim_shoot
365 case 24: return 4; // anim_duckwalkbackwards -> anim_duckwalk
366 case 25: return 4; // anim_duckwalkstrafeleft -> anim_duckwalk
367 case 26: return 4; // anim_duckwalkstraferight -> anim_duckwalk
368 case 27: return 4; // anim_duckwalkforwardright -> anim_duckwalk
369 case 28: return 4; // anim_duckwalkforwardleft -> anim_duckwalk
370 case 29: return 4; // anim_duckwalkbackright -> anim_duckwalk
371 case 30: return 4; // anim_duckwalkbackleft -> anim_duckwalk
373 LOG_DEBUGF("Frame %d missing in model %s, and we have no fallback - FAIL!", f, this.model);
376 void CSQCPlayer_FallbackFrame_Apply(entity this)
378 this.frame = CSQCPlayer_FallbackFrame(this, this.frame);
379 this.frame2 = CSQCPlayer_FallbackFrame(this, this.frame2);
380 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
381 this.frame3 = CSQCPlayer_FallbackFrame(this, this.frame3);
382 this.frame4 = CSQCPlayer_FallbackFrame(this, this.frame4);
386 // FEATURE: auto tag_index
388 .int tag_entity_lastmodelindex;
390 void CSQCModel_AutoTagIndex_Apply(entity this)
392 if(this.tag_entity && wasfreed(this.tag_entity))
393 this.tag_entity = NULL;
395 viewloc_SetTags(this);
397 MUTATOR_CALLHOOK(TagIndex_Update, this);
399 if(this.tag_networkentity)
403 if(this.tag_entity.entnum != this.tag_networkentity)
405 this.tag_entity = findfloat(NULL, entnum, this.tag_networkentity);
409 // recursive predraw call to fix issues with forcemodels and LOD if bone indexes mismatch
410 if(this.tag_entity.classname == "csqcmodel")
412 CSQCModel_Hook_PreDraw(this.tag_entity, (this.tag_entity.entnum >= 1 && this.tag_entity.entnum <= maxclients));
415 if(this.tag_entity.modelindex != this.tag_entity_lastmodelindex)
417 this.tag_entity_lastmodelindex = this.tag_entity.modelindex;
424 // the best part is: IT EXISTS
425 if(substring(this.model, 0, 14) == "models/weapons")
427 if(substring(this.tag_entity.model, 0, 14) == "models/weapons")
429 this.tag_index = gettagindex(this.tag_entity, "weapon");
431 this.tag_index = gettagindex(this.tag_entity, "tag_weapon");
434 // we need to prevent this from 'appening
435 this.tag_entity = NULL;
437 LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it");
440 else if(this.tag_entity.isplayermodel)
442 skeleton_loadinfo(this.tag_entity);
443 this.tag_index = this.tag_entity.bone_weapon;
447 if(substring(this.tag_entity.model, 0, 14) == "models/weapons")
449 this.tag_index = gettagindex(this.tag_entity, "shot");
451 this.tag_index = gettagindex(this.tag_entity, "tag_shot");
454 MUTATOR_CALLHOOK(TagIndex_Apply, this);
458 // damn, see you next frame
465 void CSQCModel_Effects_PreUpdate(entity this)
467 this.effects = this.csqcmodel_effects;
468 this.modelflags = this.csqcmodel_modelflags;
469 this.traileffect = this.csqcmodel_traileffect;
471 void Reset_ArcBeam();
472 void CSQCModel_Effects_PostUpdate(entity this)
474 if (this == csqcplayer) {
475 if (this.csqcmodel_teleported) {
479 this.csqcmodel_effects = this.effects;
480 this.csqcmodel_modelflags = this.modelflags;
481 this.csqcmodel_traileffect = this.traileffect;
484 if(this.csqcmodel_teleported)
485 Projectile_ResetTrail(this, this.origin);
488 void CSQCModel_Effects_Apply(entity this)
490 int eff = this.csqcmodel_effects & ~CSQCMODEL_EF_RESPAWNGHOST;
491 int tref = this.csqcmodel_traileffect;
493 this.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
495 this.traileffect = 0;
497 if(eff & EF_BRIGHTFIELD)
498 tref = EFFECT_TR_NEXUIZPLASMA.m_id;
499 // ignoring EF_MUZZLEFLASH
500 if(eff & EF_BRIGHTLIGHT)
501 adddynamiclight(this.origin, 400, '3 3 3');
502 if(eff & EF_DIMLIGHT)
503 adddynamiclight(this.origin, 200, '1.5 1.5 1.5');
504 if((eff & EF_NODRAW) || (this.alpha < 0))
506 if(eff & EF_ADDITIVE)
507 this.renderflags |= RF_ADDITIVE;
509 adddynamiclight(this.origin, 200, '0.15 0.15 1.5');
511 adddynamiclight(this.origin, 200, '1.5 0.15 0.15');
512 // ignoring EF_NOGUNBOB
513 if(eff & EF_FULLBRIGHT)
514 this.renderflags |= RF_FULLBRIGHT;
516 pointparticles(EFFECT_EF_FLAME, this.origin, '0 0 0', bound(0, frametime, 0.1));
517 if(eff & EF_STARDUST)
518 pointparticles(EFFECT_EF_STARDUST, this.origin, '0 0 0', bound(0, frametime, 0.1));
519 if(eff & EF_NOSHADOW)
520 this.renderflags |= RF_NOSHADOW;
521 if(eff & EF_NODEPTHTEST)
522 this.renderflags |= RF_DEPTHHACK;
523 // ignoring EF_SELECTABLE
524 if(eff & EF_DOUBLESIDED)
525 this.effects |= EF_DOUBLESIDED;
526 if(eff & EF_NOSELFSHADOW)
527 this.effects |= EF_NOSELFSHADOW;
528 if(eff & EF_DYNAMICMODELLIGHT)
529 this.renderflags |= RF_DYNAMICMODELLIGHT;
530 // ignoring EF_UNUSED18, EF_UNUSED19, EF_RESTARTANIM_BIT, EF_TELEPORT_BIT, EF_LOWPRECISION
531 if(this.csqcmodel_modelflags & MF_ROCKET)
532 tref = EFFECT_TR_ROCKET.m_id;
533 if(this.csqcmodel_modelflags & MF_GRENADE)
534 tref = EFFECT_TR_GRENADE.m_id;
535 if(this.csqcmodel_modelflags & MF_GIB)
536 tref = EFFECT_TR_BLOOD.m_id;
537 if(this.csqcmodel_modelflags & MF_ROTATE)
539 this.renderflags |= RF_USEAXIS;
540 makevectors(this.angles + '0 100 0' * fmod(time, 3.6));
542 if(this.csqcmodel_modelflags & MF_TRACER)
543 tref = EFFECT_TR_WIZSPIKE.m_id;
544 if(this.csqcmodel_modelflags & MF_ZOMGIB)
545 tref = EFFECT_TR_SLIGHTBLOOD.m_id;
546 if(this.csqcmodel_modelflags & MF_TRACER2)
547 tref = EFFECT_TR_KNIGHTSPIKE.m_id;
548 if(this.csqcmodel_modelflags & MF_TRACER3)
549 tref = EFFECT_TR_VORESPIKE.m_id;
551 this.traileffect = tref;
554 Projectile_DrawTrail(this, this.origin);
556 Projectile_ResetTrail(this, this.origin);
558 if(this.csqcmodel_effects & CSQCMODEL_EF_RESPAWNGHOST)
559 this.renderflags |= RF_ADDITIVE;
560 // also special in CSQCPlayer_GlowMod_Apply
562 if(this.csqcmodel_modelflags & MF_ROCKET)
564 if(!this.snd_looping)
566 sound(this, CH_TRIGGER_SINGLE, SND_JETPACK_FLY, VOL_BASE, autocvar_g_jetpack_attenuation);
567 this.snd_looping = CH_TRIGGER_SINGLE;
574 sound(this, this.snd_looping, SND_Null, VOL_BASE, autocvar_g_jetpack_attenuation);
575 this.snd_looping = 0;
581 .int csqcmodel_predraw_run;
583 .int anim_frame1time;
585 .int anim_frame2time;
587 .int anim_saveframe1time;
588 .int anim_saveframe2;
589 .int anim_saveframe2time;
590 .int anim_prev_pmove_flags;
591 void CSQCModel_Hook_PreDraw(entity this, bool isplayer)
593 if(this.csqcmodel_predraw_run == framecount)
595 this.csqcmodel_predraw_run = framecount;
597 if(!this.modelindex || this.model == "null")
603 this.drawmask = MASK_NORMAL;
605 if(this.isplayermodel) // this checks if it's a player MODEL!
607 CSQCPlayer_ModelAppearance_Apply(this, this.entnum == player_localnum + 1);
608 CSQCPlayer_LOD_Apply(this);
612 skeleton_loadinfo(this);
613 bool doblend = (this.bone_upperbody >= 0);
614 CSQCPlayer_FallbackFrame_Apply(this);
617 skeleton_from_frames(this, this.csqcmodel_isdead);
621 free_skeleton_from_frames(this);
622 // just in case, clear these (we're animating in frame and frame3)
629 // we know that frame3 and frame4 fields, used by InterpolateAnimation, are left alone - but that is all we know!
630 skeleton_loadinfo(this);
631 bool doblend = (this.bone_upperbody >= 0);
633 if(this == csqcplayer)
635 if(IS_ONGROUND(this))
637 this.anim_prev_pmove_flags = this.flags;
638 if(this.flags & FL_DUCKED)
639 animdecide_setstate(this, this.anim_state | ANIMSTATE_DUCK, false);
640 else if(this.anim_state & ANIMSTATE_DUCK)
641 animdecide_setstate(this, this.anim_state - ANIMSTATE_DUCK, false);
645 tracebox(this.origin + '0 0 1', this.mins, this.maxs, this.origin - '0 0 4', MOVE_NORMAL, this);
646 if(trace_startsolid || trace_fraction < 1)
649 animdecide_load_if_needed(this);
650 animdecide_setimplicitstate(this, onground);
651 animdecide_setframes(this, doblend, anim_frame, anim_frame1time, anim_frame2, anim_frame2time);
653 if(this.anim_saveframe != this.anim_frame || this.anim_saveframe1time != this.anim_frame1time)
654 sf |= CSQCMODEL_PROPERTY_FRAME;
655 if(this.anim_saveframe2 != this.anim_frame2 || this.anim_saveframe2time != this.anim_frame2time)
656 sf |= CSQCMODEL_PROPERTY_FRAME2;
657 this.anim_saveframe = this.anim_frame;
658 this.anim_saveframe1time = this.anim_frame1time;
659 this.anim_saveframe2 = this.anim_frame2;
660 this.anim_saveframe2time = this.anim_frame2time;
661 // Note: we always consider lerpfrac "changed", as it uses fixed values every time anyway.
662 // This ensures that .frame etc. are always written.
663 CSQCModel_InterpolateAnimation_2To4_PreNote(this, sf | CSQCMODEL_PROPERTY_LERPFRAC);
664 this.lerpfrac = (doblend ? 0.5 : 0);
665 this.frame = this.anim_frame;
666 this.frame1time = this.anim_frame1time;
667 this.frame2 = this.anim_frame2;
668 this.frame2time = this.anim_frame2time;
669 CSQCModel_InterpolateAnimation_2To4_Note(this, sf | CSQCMODEL_PROPERTY_LERPFRAC, false);
670 CSQCModel_InterpolateAnimation_2To4_Do(this);
673 skeleton_from_frames(this, this.csqcmodel_isdead);
677 free_skeleton_from_frames(this);
678 // just in case, clear these (we're animating in frame and frame3)
685 CSQCModel_AutoTagIndex_Apply(this);
687 CSQCModel_Effects_Apply(this);
690 void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
692 // interpolate v_angle
693 this.iflags |= IFLAG_V_ANGLE_X;
694 // revert to values from server
695 CSQCModel_Effects_PreUpdate(this);
696 if(this.isplayermodel)
699 CSQCPlayer_FallbackFrame_PreUpdate(this);
700 CSQCPlayer_ModelAppearance_PreUpdate(this);
704 void CSQCModel_Hook_PostUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
706 // is it a player model? (shared state)
707 this.isplayermodel = (substring(this.model, 0, 14) == "models/player/" || substring(this.model, 0, 17) == "models/ok_player/" || (substring(this.model, 0, 16) == "models/monsters/" && (this.entnum >= 1 && this.entnum <= maxclients)));
709 // save values set by server
710 if(this.isplayermodel)
712 CSQCPlayer_ModelAppearance_PostUpdate(this);
714 CSQCPlayer_AnimDecide_PostUpdate(this, isnew);
716 CSQCPlayer_FallbackFrame_PostUpdate(this, isnew);
718 CSQCModel_Effects_PostUpdate(this);