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/physics/movetypes/movetypes.qh>
7 #include <common/viewloc.qh>
8 #include <lib/csqcmodel/cl_model.qh>
9 #include <lib/csqcmodel/cl_player.qh>
10 #include <lib/csqcmodel/interpolate.qh>
15 void CSQCModel_Hook_PreDraw(entity this, bool isplayer);
23 void CSQCPlayer_LOD_Apply(entity this)
26 if(this.lodmodelindex0 != this.modelindex)
28 string modelname = this.model;
31 vector mi = this.mins;
32 vector ma = this.maxs;
35 this.lodmodelindex0 = this.modelindex;
36 this.lodmodelindex1 = this.modelindex;
37 this.lodmodelindex2 = this.modelindex;
39 // FIXME: this only supports 3-letter extensions
40 s = strcat(substring(modelname, 0, strlen(modelname)-4), "_lod1", substring(modelname, -4, 4));
46 this.lodmodelindex1 = this.modelindex;
49 s = strcat(substring(modelname, 0, strlen(modelname)-4), "_lod2", substring(modelname, -4, 4));
55 this.lodmodelindex2 = this.modelindex;
58 _setmodel(this, modelname); // make everything normal again
59 setsize(this, mi, ma);
63 if(autocvar_cl_playerdetailreduction <= 0)
65 if(autocvar_cl_playerdetailreduction <= -2)
66 this.modelindex = this.lodmodelindex2;
67 else if(autocvar_cl_playerdetailreduction <= -1)
68 this.modelindex = this.lodmodelindex1;
70 this.modelindex = this.lodmodelindex0;
74 float distance = vlen(this.origin - view_origin);
75 float f = (distance * current_viewzoom + 100.0) * autocvar_cl_playerdetailreduction;
76 f *= 1.0 / bound(0.01, view_quality, 1);
77 if(f > autocvar_cl_loddistance2)
78 this.modelindex = this.lodmodelindex2;
79 else if(f > autocvar_cl_loddistance1)
80 this.modelindex = this.lodmodelindex1;
82 this.modelindex = this.lodmodelindex0;
86 // FEATURE: forcemodel and model color selection (MUST be called BEFORE LOD!)
87 string forceplayermodels_model;
88 bool forceplayermodels_modelisgoodmodel;
89 int forceplayermodels_modelindex;
90 int forceplayermodels_skin;
92 string forceplayermodels_mymodel;
93 bool forceplayermodels_myisgoodmodel;
94 int forceplayermodels_mymodelindex;
96 bool forceplayermodels_attempted;
98 .string forceplayermodels_savemodel;
99 .int forceplayermodels_savemodelindex;
100 .int forceplayermodels_saveskin;
101 .int forceplayermodels_savecolormap;
103 .string forceplayermodels_isgoodmodel_mdl;
104 .bool forceplayermodels_isgoodmodel;
106 string forceplayermodels_goodmodel;
107 int forceplayermodels_goodmodelindex;
112 void CSQCPlayer_ModelAppearance_PreUpdate(entity this)
114 this.model = this.forceplayermodels_savemodel;
115 this.modelindex = this.forceplayermodels_savemodelindex;
116 this.skin = this.forceplayermodels_saveskin;
117 this.colormap = this.forceplayermodels_savecolormap;
119 void CSQCPlayer_ModelAppearance_PostUpdate(entity this)
121 this.forceplayermodels_savemodel = this.model;
122 this.forceplayermodels_savemodelindex = this.modelindex;
123 this.forceplayermodels_saveskin = this.skin;
124 this.forceplayermodels_savecolormap = this.colormap;
126 if(this.forceplayermodels_savemodel != this.forceplayermodels_isgoodmodel_mdl)
128 this.forceplayermodels_isgoodmodel = fexists(this.forceplayermodels_savemodel);
129 this.forceplayermodels_isgoodmodel_mdl = this.forceplayermodels_savemodel;
130 if(!this.forceplayermodels_isgoodmodel)
131 LOG_INFOF("Warning: missing model %s has been used\n", this.forceplayermodels_savemodel);
134 void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
137 // which one is ALWAYS good?
138 if (!forceplayermodels_goodmodel)
141 precache_model(cvar_defstring("_cl_playermodel"));
142 _setmodel(e, cvar_defstring("_cl_playermodel"));
143 forceplayermodels_goodmodel = e.model;
144 forceplayermodels_goodmodelindex = e.modelindex;
148 // first, try finding it from the server
149 if(this.forceplayermodels_savemodelindex && this.forceplayermodels_savemodel != "null")
153 if(!isdemo()) // this is mainly cheat protection; not needed for demos
155 // trust server's idea of "own player model"
156 forceplayermodels_modelisgoodmodel = this.forceplayermodels_isgoodmodel;
157 forceplayermodels_model = this.forceplayermodels_savemodel;
158 forceplayermodels_modelindex = this.forceplayermodels_savemodelindex;
159 forceplayermodels_skin = this.forceplayermodels_saveskin;
160 forceplayermodels_attempted = 1;
165 // forcemodel finding
166 if(!forceplayermodels_attempted)
168 forceplayermodels_attempted = 1;
170 // only if this failed, find it out on our own
172 precache_model(autocvar__cl_playermodel);
173 _setmodel(e, autocvar__cl_playermodel); // this is harmless, see below
174 forceplayermodels_modelisgoodmodel = fexists(e.model);
175 forceplayermodels_model = e.model;
176 forceplayermodels_modelindex = e.modelindex;
177 forceplayermodels_skin = autocvar__cl_playerskin;
181 if(autocvar_cl_forcemyplayermodel != "" && autocvar_cl_forcemyplayermodel != forceplayermodels_mymodel)
184 _setmodel(e, autocvar_cl_forcemyplayermodel); // this is harmless, see below
185 forceplayermodels_myisgoodmodel = fexists(e.model);
186 forceplayermodels_mymodel = e.model;
187 forceplayermodels_mymodelindex = e.modelindex;
194 cm = this.forceplayermodels_savecolormap;
195 cm = (cm >= 1024) ? cm : (stof(getplayerkeyvalue(cm - 1, "colors")) + 1024);
198 isfriend = (cm == 1024 + 17 * myteam);
200 isfriend = islocalplayer;
202 if(autocvar_cl_forcemyplayermodel != "" && forceplayermodels_myisgoodmodel && isfriend)
204 this.model = forceplayermodels_mymodel;
205 this.modelindex = forceplayermodels_mymodelindex;
206 this.skin = autocvar_cl_forcemyplayerskin;
208 else if(autocvar_cl_forceplayermodels && forceplayermodels_modelisgoodmodel)
210 this.model = forceplayermodels_model;
211 this.modelindex = forceplayermodels_modelindex;
212 this.skin = forceplayermodels_skin;
214 else if(this.forceplayermodels_isgoodmodel)
216 this.model = this.forceplayermodels_savemodel;
217 this.modelindex = this.forceplayermodels_savemodelindex;
218 this.skin = this.forceplayermodels_saveskin;
222 this.model = forceplayermodels_goodmodel;
223 this.modelindex = forceplayermodels_goodmodelindex;
224 this.skin = this.forceplayermodels_saveskin;
227 // forceplayercolors too
230 // own team's color is never forced
231 int forcecolor_friend = 0;
232 int forcecolor_enemy = 0;
235 if(autocvar_cl_forcemyplayercolors)
236 forcecolor_friend = 1024 + autocvar_cl_forcemyplayercolors;
237 if(autocvar_cl_forceplayercolors == 2 && team_count == 2)
238 forcecolor_enemy = 1024 + autocvar__cl_color;
240 if(forcecolor_enemy && !forcecolor_friend)
242 // only enemy color is forced?
243 // verify it is not equal to the friend color
244 if(forcecolor_enemy == 1024 + 17 * myteam)
245 forcecolor_enemy = 0;
248 if(forcecolor_friend && !forcecolor_enemy)
250 // only friend color is forced?
251 // verify it is not equal to the enemy color
252 for(tm = teams.sort_next; tm; tm = tm.sort_next)
253 // note: we even compare against our own team.
254 // if we rejected because we matched our OWN team color,
255 // this is not bad; we then simply keep our color as is
257 if(forcecolor_friend == 1024 + 17 * tm.team)
258 forcecolor_friend = 0;
261 if(cm == 1024 + 17 * myteam)
263 if(forcecolor_friend)
264 this.colormap = forcecolor_friend;
269 this.colormap = forcecolor_enemy;
274 if(autocvar_cl_forcemyplayercolors && islocalplayer)
275 this.colormap = 1024 + autocvar_cl_forcemyplayercolors;
276 else if(autocvar_cl_forceplayercolors)
277 this.colormap = player_localnum + 1;
280 // GLOWMOD AND DEATH FADING
281 if(this.colormap > 0)
282 this.glowmod = colormapPaletteColor(((this.colormap >= 1024) ? this.colormap : stof(getplayerkeyvalue(this.colormap - 1, "colors"))) & 0x0F, true) * 2;
284 this.glowmod = '1 1 1';
286 if(autocvar_cl_deathglow > 0)
288 if(this.csqcmodel_isdead)
290 // Fade out to black now...
291 if(this.old_glowmod == '0 0 0') { this.old_glowmod = this.glowmod; }
294 this.glowmod = this.old_glowmod * bound(0, 1 - (time - this.death_time) / autocvar_cl_deathglow, 1);
295 this.glowmod_x = max(this.glowmod.x, 0.0001);
296 this.glowmod_y = max(this.glowmod.y, 0.0001);
297 this.glowmod_z = max(this.glowmod.z, 0.0001);
299 else if(this.old_glowmod != '0 0 0') { this.old_glowmod = '0 0 0'; }
302 //printf("CSQCPlayer_ModelAppearance_Apply(): state = %s, colormap = %f, glowmod = %s\n", (this.csqcmodel_isdead ? "DEAD" : "ALIVE"), this.colormap, vtos(this.glowmod));
305 // FEATURE: fallback frames
306 .int csqcmodel_saveframe;
307 .int csqcmodel_saveframe2;
308 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
309 .int csqcmodel_saveframe3;
310 .int csqcmodel_saveframe4;
312 .int csqcmodel_framecount;
314 #define IS_DEAD_FRAME(f) ((f) == 0 || (f) == 1)
315 void CSQCPlayer_FallbackFrame_PreUpdate(entity this)
317 this.frame = this.csqcmodel_saveframe;
318 this.frame2 = this.csqcmodel_saveframe2;
319 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
320 this.frame3 = this.csqcmodel_saveframe3;
321 this.frame4 = this.csqcmodel_saveframe4;
324 void CSQCPlayer_FallbackFrame_PostUpdate(entity this, bool isnew)
326 this.csqcmodel_saveframe = this.frame;
327 this.csqcmodel_saveframe2 = this.frame2;
328 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
329 this.csqcmodel_saveframe3 = this.frame3;
330 this.csqcmodel_saveframe4 = this.frame4;
333 // hack for death animations: set their frametime to zero in case a
337 #define FIX_FRAMETIME(f,ft) MACRO_BEGIN { \
338 if(IS_DEAD_FRAME(this.f) && this.ft != 0 && this.death_time != 0) \
339 this.ft = this.death_time; \
341 FIX_FRAMETIME(frame, frame1time);
342 FIX_FRAMETIME(frame2, frame2time);
343 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
344 FIX_FRAMETIME(frame3, frame3time);
345 FIX_FRAMETIME(frame4, frame4time);
348 this.csqcmodel_isdead = IS_DEAD_FRAME(this.frame);
350 void CSQCPlayer_AnimDecide_PostUpdate(entity this, bool isnew)
352 this.csqcmodel_isdead = boolean(this.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
354 int CSQCPlayer_FallbackFrame(entity this, int f)
357 if(frameduration(this.modelindex, f) > 0)
358 return f; // goooooood
359 if(frameduration(this.modelindex, 1) <= 0)
360 return f; // this is a static model. We can't fix it if we wanted to
363 case 23: return 11; // anim_melee -> anim_shoot
364 case 24: return 4; // anim_duckwalkbackwards -> anim_duckwalk
365 case 25: return 4; // anim_duckwalkstrafeleft -> anim_duckwalk
366 case 26: return 4; // anim_duckwalkstraferight -> anim_duckwalk
367 case 27: return 4; // anim_duckwalkforwardright -> anim_duckwalk
368 case 28: return 4; // anim_duckwalkforwardleft -> anim_duckwalk
369 case 29: return 4; // anim_duckwalkbackright -> anim_duckwalk
370 case 30: return 4; // anim_duckwalkbackleft -> anim_duckwalk
372 LOG_DEBUGF("Frame %d missing in model %s, and we have no fallback - FAIL!", f, this.model);
375 void CSQCPlayer_FallbackFrame_Apply(entity this)
377 this.frame = CSQCPlayer_FallbackFrame(this, this.frame);
378 this.frame2 = CSQCPlayer_FallbackFrame(this, this.frame2);
379 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
380 this.frame3 = CSQCPlayer_FallbackFrame(this, this.frame3);
381 this.frame4 = CSQCPlayer_FallbackFrame(this, this.frame4);
385 // FEATURE: auto tag_index
387 .int tag_entity_lastmodelindex;
389 void CSQCModel_AutoTagIndex_Apply(entity this)
391 if(this.tag_entity && wasfreed(this.tag_entity))
392 this.tag_entity = NULL;
394 viewloc_SetTags(this);
396 MUTATOR_CALLHOOK(TagIndex_Update, this);
398 if(this.tag_networkentity)
402 if(this.tag_entity.entnum != this.tag_networkentity)
404 this.tag_entity = findfloat(NULL, entnum, this.tag_networkentity);
408 // recursive predraw call to fix issues with forcemodels and LOD if bone indexes mismatch
409 if(this.tag_entity.classname == "csqcmodel")
411 CSQCModel_Hook_PreDraw(this.tag_entity, (this.tag_entity.entnum >= 1 && this.tag_entity.entnum <= maxclients));
414 if(this.tag_entity.modelindex != this.tag_entity_lastmodelindex)
416 this.tag_entity_lastmodelindex = this.tag_entity.modelindex;
423 // the best part is: IT EXISTS
424 if(substring(this.model, 0, 14) == "models/weapons")
426 if(substring(this.tag_entity.model, 0, 14) == "models/weapons")
428 this.tag_index = gettagindex(this.tag_entity, "weapon");
430 this.tag_index = gettagindex(this.tag_entity, "tag_weapon");
433 // we need to prevent this from 'appening
434 this.tag_entity = NULL;
436 LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it");
439 else if(this.tag_entity.isplayermodel)
441 skeleton_loadinfo(this.tag_entity);
442 this.tag_index = this.tag_entity.bone_weapon;
446 if(substring(this.tag_entity.model, 0, 14) == "models/weapons")
448 this.tag_index = gettagindex(this.tag_entity, "shot");
450 this.tag_index = gettagindex(this.tag_entity, "tag_shot");
453 MUTATOR_CALLHOOK(TagIndex_Apply, this);
457 // damn, see you next frame
464 void CSQCModel_Effects_PreUpdate(entity this)
466 this.effects = this.csqcmodel_effects;
467 this.modelflags = this.csqcmodel_modelflags;
468 this.traileffect = this.csqcmodel_traileffect;
470 void Reset_ArcBeam();
471 void CSQCModel_Effects_PostUpdate(entity this)
473 if (this == csqcplayer) {
474 if (this.csqcmodel_teleported) {
478 this.csqcmodel_effects = this.effects;
479 this.csqcmodel_modelflags = this.modelflags;
480 this.csqcmodel_traileffect = this.traileffect;
483 if(this.csqcmodel_teleported)
484 Projectile_ResetTrail(this, this.origin);
487 void CSQCModel_Effects_Apply(entity this)
489 int eff = this.csqcmodel_effects & ~CSQCMODEL_EF_RESPAWNGHOST;
490 int tref = this.csqcmodel_traileffect;
492 this.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
494 this.traileffect = 0;
496 if(eff & EF_BRIGHTFIELD)
497 tref = EFFECT_TR_NEXUIZPLASMA.m_id;
498 // ignoring EF_MUZZLEFLASH
499 if(eff & EF_BRIGHTLIGHT)
500 adddynamiclight(this.origin, 400, '3 3 3');
501 if(eff & EF_DIMLIGHT)
502 adddynamiclight(this.origin, 200, '1.5 1.5 1.5');
503 if((eff & EF_NODRAW) || (this.alpha < 0))
505 if(eff & EF_ADDITIVE)
506 this.renderflags |= RF_ADDITIVE;
508 adddynamiclight(this.origin, 200, '0.15 0.15 1.5');
510 adddynamiclight(this.origin, 200, '1.5 0.15 0.15');
511 // ignoring EF_NOGUNBOB
512 if(eff & EF_FULLBRIGHT)
513 this.renderflags |= RF_FULLBRIGHT;
515 pointparticles(EFFECT_EF_FLAME, this.origin, '0 0 0', bound(0, frametime, 0.1));
516 if(eff & EF_STARDUST)
517 pointparticles(EFFECT_EF_STARDUST, this.origin, '0 0 0', bound(0, frametime, 0.1));
518 if(eff & EF_NOSHADOW)
519 this.renderflags |= RF_NOSHADOW;
520 if(eff & EF_NODEPTHTEST)
521 this.renderflags |= RF_DEPTHHACK;
522 // ignoring EF_SELECTABLE
523 if(eff & EF_DOUBLESIDED)
524 this.effects |= EF_DOUBLESIDED;
525 if(eff & EF_NOSELFSHADOW)
526 this.effects |= EF_NOSELFSHADOW;
527 if(eff & EF_DYNAMICMODELLIGHT)
528 this.renderflags |= RF_DYNAMICMODELLIGHT;
529 // ignoring EF_UNUSED18, EF_UNUSED19, EF_RESTARTANIM_BIT, EF_TELEPORT_BIT, EF_LOWPRECISION
530 if(this.csqcmodel_modelflags & MF_ROCKET)
531 tref = EFFECT_TR_ROCKET.m_id;
532 if(this.csqcmodel_modelflags & MF_GRENADE)
533 tref = EFFECT_TR_GRENADE.m_id;
534 if(this.csqcmodel_modelflags & MF_GIB)
535 tref = EFFECT_TR_BLOOD.m_id;
536 if(this.csqcmodel_modelflags & MF_ROTATE)
538 this.renderflags |= RF_USEAXIS;
539 makevectors(this.angles + '0 100 0' * fmod(time, 3.6));
541 if(this.csqcmodel_modelflags & MF_TRACER)
542 tref = EFFECT_TR_WIZSPIKE.m_id;
543 if(this.csqcmodel_modelflags & MF_ZOMGIB)
544 tref = EFFECT_TR_SLIGHTBLOOD.m_id;
545 if(this.csqcmodel_modelflags & MF_TRACER2)
546 tref = EFFECT_TR_KNIGHTSPIKE.m_id;
547 if(this.csqcmodel_modelflags & MF_TRACER3)
548 tref = EFFECT_TR_VORESPIKE.m_id;
550 this.traileffect = tref;
553 Projectile_DrawTrail(this, this.origin);
555 Projectile_ResetTrail(this, this.origin);
557 if(this.csqcmodel_effects & CSQCMODEL_EF_RESPAWNGHOST)
558 this.renderflags |= RF_ADDITIVE;
559 // also special in CSQCPlayer_GlowMod_Apply
561 if(this.csqcmodel_modelflags & MF_ROCKET)
563 if(!this.snd_looping)
565 sound(this, CH_TRIGGER_SINGLE, SND_JETPACK_FLY, VOL_BASE, autocvar_g_jetpack_attenuation);
566 this.snd_looping = CH_TRIGGER_SINGLE;
573 sound(this, this.snd_looping, SND_Null, VOL_BASE, autocvar_g_jetpack_attenuation);
574 this.snd_looping = 0;
580 .int csqcmodel_predraw_run;
582 .int anim_frame1time;
584 .int anim_frame2time;
586 .int anim_saveframe1time;
587 .int anim_saveframe2;
588 .int anim_saveframe2time;
589 .int anim_prev_pmove_flags;
590 void CSQCModel_Hook_PreDraw(entity this, bool isplayer)
592 if(this.csqcmodel_predraw_run == framecount)
594 this.csqcmodel_predraw_run = framecount;
596 if(!this.modelindex || this.model == "null")
602 this.drawmask = MASK_NORMAL;
604 if(this.isplayermodel) // this checks if it's a player MODEL!
606 CSQCPlayer_ModelAppearance_Apply(this, this.entnum == player_localnum + 1);
607 CSQCPlayer_LOD_Apply(this);
611 skeleton_loadinfo(this);
612 bool doblend = (this.bone_upperbody >= 0);
613 CSQCPlayer_FallbackFrame_Apply(this);
616 skeleton_from_frames(this, this.csqcmodel_isdead);
620 free_skeleton_from_frames(this);
621 // just in case, clear these (we're animating in frame and frame3)
628 // we know that frame3 and frame4 fields, used by InterpolateAnimation, are left alone - but that is all we know!
629 skeleton_loadinfo(this);
630 bool doblend = (this.bone_upperbody >= 0);
632 if(this == csqcplayer)
634 if(IS_ONGROUND(this))
636 this.anim_prev_pmove_flags = this.flags;
637 if(this.flags & FL_DUCKED)
638 animdecide_setstate(this, this.anim_state | ANIMSTATE_DUCK, false);
639 else if(this.anim_state & ANIMSTATE_DUCK)
640 animdecide_setstate(this, this.anim_state - ANIMSTATE_DUCK, false);
644 tracebox(this.origin + '0 0 1', this.mins, this.maxs, this.origin - '0 0 4', MOVE_NORMAL, this);
645 if(trace_startsolid || trace_fraction < 1)
648 animdecide_load_if_needed(this);
649 animdecide_setimplicitstate(this, onground);
650 animdecide_setframes(this, doblend, anim_frame, anim_frame1time, anim_frame2, anim_frame2time);
652 if(this.anim_saveframe != this.anim_frame || this.anim_saveframe1time != this.anim_frame1time)
653 sf |= CSQCMODEL_PROPERTY_FRAME;
654 if(this.anim_saveframe2 != this.anim_frame2 || this.anim_saveframe2time != this.anim_frame2time)
655 sf |= CSQCMODEL_PROPERTY_FRAME2;
656 this.anim_saveframe = this.anim_frame;
657 this.anim_saveframe1time = this.anim_frame1time;
658 this.anim_saveframe2 = this.anim_frame2;
659 this.anim_saveframe2time = this.anim_frame2time;
660 // Note: we always consider lerpfrac "changed", as it uses fixed values every time anyway.
661 // This ensures that .frame etc. are always written.
662 CSQCModel_InterpolateAnimation_2To4_PreNote(this, sf | CSQCMODEL_PROPERTY_LERPFRAC);
663 this.lerpfrac = (doblend ? 0.5 : 0);
664 this.frame = this.anim_frame;
665 this.frame1time = this.anim_frame1time;
666 this.frame2 = this.anim_frame2;
667 this.frame2time = this.anim_frame2time;
668 CSQCModel_InterpolateAnimation_2To4_Note(this, sf | CSQCMODEL_PROPERTY_LERPFRAC, false);
669 CSQCModel_InterpolateAnimation_2To4_Do(this);
672 skeleton_from_frames(this, this.csqcmodel_isdead);
676 free_skeleton_from_frames(this);
677 // just in case, clear these (we're animating in frame and frame3)
684 CSQCModel_AutoTagIndex_Apply(this);
686 CSQCModel_Effects_Apply(this);
689 void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
691 // interpolate v_angle
692 this.iflags |= IFLAG_V_ANGLE_X;
693 // revert to values from server
694 CSQCModel_Effects_PreUpdate(this);
695 if(this.isplayermodel)
698 CSQCPlayer_FallbackFrame_PreUpdate(this);
699 CSQCPlayer_ModelAppearance_PreUpdate(this);
703 void CSQCModel_Hook_PostUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
705 // is it a player model? (shared state)
706 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)));
708 // save values set by server
709 if(this.isplayermodel)
711 CSQCPlayer_ModelAppearance_PostUpdate(this);
713 CSQCPlayer_AnimDecide_PostUpdate(this, isnew);
715 CSQCPlayer_FallbackFrame_PostUpdate(this, isnew);
717 CSQCModel_Effects_PostUpdate(this);