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)
137 if(MUTATOR_CALLHOOK(ForcePlayermodels_Skip, this, islocalplayer))
138 goto skipforcemodels;
141 // which one is ALWAYS good?
142 if (!forceplayermodels_goodmodel)
145 precache_model(cvar_defstring("_cl_playermodel"));
146 _setmodel(e, cvar_defstring("_cl_playermodel"));
147 forceplayermodels_goodmodel = e.model;
148 forceplayermodels_goodmodelindex = e.modelindex;
152 // first, try finding it from the server
153 if(this.forceplayermodels_savemodelindex && this.forceplayermodels_savemodel != "null")
157 if(!isdemo()) // this is mainly cheat protection; not needed for demos
159 // trust server's idea of "own player model"
160 forceplayermodels_modelisgoodmodel = this.forceplayermodels_isgoodmodel;
161 forceplayermodels_model = this.forceplayermodels_savemodel;
162 forceplayermodels_modelindex = this.forceplayermodels_savemodelindex;
163 forceplayermodels_skin = this.forceplayermodels_saveskin;
164 forceplayermodels_attempted = 1;
169 // forcemodel finding
170 if(!forceplayermodels_attempted)
172 forceplayermodels_attempted = 1;
174 // only if this failed, find it out on our own
176 precache_model(autocvar__cl_playermodel);
177 _setmodel(e, autocvar__cl_playermodel); // this is harmless, see below
178 forceplayermodels_modelisgoodmodel = fexists(e.model);
179 forceplayermodels_model = e.model;
180 forceplayermodels_modelindex = e.modelindex;
181 forceplayermodels_skin = autocvar__cl_playerskin;
185 if(autocvar_cl_forcemyplayermodel != "" && autocvar_cl_forcemyplayermodel != forceplayermodels_mymodel)
188 _setmodel(e, autocvar_cl_forcemyplayermodel); // this is harmless, see below
189 forceplayermodels_myisgoodmodel = fexists(e.model);
190 forceplayermodels_mymodel = e.model;
191 forceplayermodels_mymodelindex = e.modelindex;
198 cm = this.forceplayermodels_savecolormap;
199 cm = (cm >= 1024) ? cm : (entcs_GetClientColors(cm - 1) + 1024);
202 isfriend = (cm == 1024 + 17 * myteam);
204 isfriend = islocalplayer;
206 if(autocvar_cl_forcemyplayermodel != "" && forceplayermodels_myisgoodmodel && isfriend)
208 this.model = forceplayermodels_mymodel;
209 this.modelindex = forceplayermodels_mymodelindex;
210 this.skin = autocvar_cl_forcemyplayerskin;
212 else if(autocvar_cl_forceplayermodels && forceplayermodels_modelisgoodmodel)
214 this.model = forceplayermodels_model;
215 this.modelindex = forceplayermodels_modelindex;
216 this.skin = forceplayermodels_skin;
218 else if(this.forceplayermodels_isgoodmodel)
220 this.model = this.forceplayermodels_savemodel;
221 this.modelindex = this.forceplayermodels_savemodelindex;
222 this.skin = this.forceplayermodels_saveskin;
226 this.model = forceplayermodels_goodmodel;
227 this.modelindex = forceplayermodels_goodmodelindex;
228 this.skin = this.forceplayermodels_saveskin;
231 // forceplayercolors too
234 // own team's color is never forced
235 int forcecolor_friend = 0;
236 int forcecolor_enemy = 0;
239 if(autocvar_cl_forcemyplayercolors)
240 forcecolor_friend = 1024 + autocvar_cl_forcemyplayercolors;
241 if(autocvar_cl_forceplayercolors == 2 && team_count == 2)
242 forcecolor_enemy = 1024 + autocvar__cl_color;
244 if(forcecolor_enemy && !forcecolor_friend)
246 // only enemy color is forced?
247 // verify it is not equal to the friend color
248 if(forcecolor_enemy == 1024 + 17 * myteam)
249 forcecolor_enemy = 0;
252 if(forcecolor_friend && !forcecolor_enemy)
254 // only friend color is forced?
255 // verify it is not equal to the enemy color
256 for(tm = teams.sort_next; tm; tm = tm.sort_next)
257 // note: we even compare against our own team.
258 // if we rejected because we matched our OWN team color,
259 // this is not bad; we then simply keep our color as is
261 if(forcecolor_friend == 1024 + 17 * tm.team)
262 forcecolor_friend = 0;
265 if(cm == 1024 + 17 * myteam)
267 if(forcecolor_friend)
268 this.colormap = forcecolor_friend;
273 this.colormap = forcecolor_enemy;
278 if(autocvar_cl_forcemyplayercolors && islocalplayer)
279 this.colormap = 1024 + autocvar_cl_forcemyplayercolors;
280 else if(autocvar_cl_forceplayercolors)
281 this.colormap = player_localnum + 1;
284 LABEL(skipforcemodels)
286 // GLOWMOD AND DEATH FADING
287 if(this.colormap > 0)
288 this.glowmod = colormapPaletteColor(((this.colormap >= 1024) ? this.colormap : entcs_GetClientColors(this.colormap - 1)) & 0x0F, true) * 2;
290 this.glowmod = '1 1 1';
292 if(autocvar_cl_deathglow > 0)
294 if(this.csqcmodel_isdead)
296 // Fade out to black now...
297 if(this.old_glowmod == '0 0 0') { this.old_glowmod = this.glowmod; }
300 this.glowmod = this.old_glowmod * bound(0, 1 - (time - this.death_time) / autocvar_cl_deathglow, 1);
301 this.glowmod_x = max(this.glowmod.x, 0.0001);
302 this.glowmod_y = max(this.glowmod.y, 0.0001);
303 this.glowmod_z = max(this.glowmod.z, 0.0001);
305 else if(this.old_glowmod != '0 0 0') { this.old_glowmod = '0 0 0'; }
308 //printf("CSQCPlayer_ModelAppearance_Apply(): state = %s, colormap = %f, glowmod = %s\n", (this.csqcmodel_isdead ? "DEAD" : "ALIVE"), this.colormap, vtos(this.glowmod));
311 // FEATURE: fallback frames
312 .int csqcmodel_saveframe;
313 .int csqcmodel_saveframe2;
314 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
315 .int csqcmodel_saveframe3;
316 .int csqcmodel_saveframe4;
318 .int csqcmodel_framecount;
320 #define IS_DEAD_FRAME(f) ((f) == 0 || (f) == 1)
321 void CSQCPlayer_FallbackFrame_PreUpdate(entity this)
323 this.frame = this.csqcmodel_saveframe;
324 this.frame2 = this.csqcmodel_saveframe2;
325 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
326 this.frame3 = this.csqcmodel_saveframe3;
327 this.frame4 = this.csqcmodel_saveframe4;
330 void CSQCPlayer_FallbackFrame_PostUpdate(entity this, bool isnew)
332 this.csqcmodel_saveframe = this.frame;
333 this.csqcmodel_saveframe2 = this.frame2;
334 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
335 this.csqcmodel_saveframe3 = this.frame3;
336 this.csqcmodel_saveframe4 = this.frame4;
339 // hack for death animations: set their frametime to zero in case a
343 #define FIX_FRAMETIME(f,ft) MACRO_BEGIN { \
344 if(IS_DEAD_FRAME(this.f) && this.ft != 0 && this.death_time != 0) \
345 this.ft = this.death_time; \
347 FIX_FRAMETIME(frame, frame1time);
348 FIX_FRAMETIME(frame2, frame2time);
349 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
350 FIX_FRAMETIME(frame3, frame3time);
351 FIX_FRAMETIME(frame4, frame4time);
354 this.csqcmodel_isdead = IS_DEAD_FRAME(this.frame);
356 void CSQCPlayer_AnimDecide_PostUpdate(entity this, bool isnew)
358 this.csqcmodel_isdead = boolean(this.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
360 int CSQCPlayer_FallbackFrame(entity this, int f)
363 if(frameduration(this.modelindex, f) > 0)
364 return f; // goooooood
365 if(frameduration(this.modelindex, 1) <= 0)
366 return f; // this is a static model. We can't fix it if we wanted to
369 case 23: return 11; // anim_melee -> anim_shoot
370 case 24: return 4; // anim_duckwalkbackwards -> anim_duckwalk
371 case 25: return 4; // anim_duckwalkstrafeleft -> anim_duckwalk
372 case 26: return 4; // anim_duckwalkstraferight -> anim_duckwalk
373 case 27: return 4; // anim_duckwalkforwardright -> anim_duckwalk
374 case 28: return 4; // anim_duckwalkforwardleft -> anim_duckwalk
375 case 29: return 4; // anim_duckwalkbackright -> anim_duckwalk
376 case 30: return 4; // anim_duckwalkbackleft -> anim_duckwalk
378 LOG_DEBUGF("Frame %d missing in model %s, and we have no fallback - FAIL!", f, this.model);
381 void CSQCPlayer_FallbackFrame_Apply(entity this)
383 this.frame = CSQCPlayer_FallbackFrame(this, this.frame);
384 this.frame2 = CSQCPlayer_FallbackFrame(this, this.frame2);
385 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
386 this.frame3 = CSQCPlayer_FallbackFrame(this, this.frame3);
387 this.frame4 = CSQCPlayer_FallbackFrame(this, this.frame4);
391 // FEATURE: auto tag_index
393 .int tag_entity_lastmodelindex;
395 void CSQCModel_AutoTagIndex_Apply(entity this)
397 if(this.tag_entity && wasfreed(this.tag_entity))
398 this.tag_entity = NULL;
400 MUTATOR_CALLHOOK(TagIndex_Update, this);
402 if(this.tag_networkentity)
406 if(this.tag_entity.entnum != this.tag_networkentity)
408 this.tag_entity = findfloat(NULL, entnum, this.tag_networkentity);
412 // recursive predraw call to fix issues with forcemodels and LOD if bone indexes mismatch
413 if(this.tag_entity.classname == "csqcmodel")
415 CSQCModel_Hook_PreDraw(this.tag_entity, (this.tag_entity.entnum >= 1 && this.tag_entity.entnum <= maxclients));
418 if(this.tag_entity.modelindex != this.tag_entity_lastmodelindex)
420 this.tag_entity_lastmodelindex = this.tag_entity.modelindex;
427 // the best part is: IT EXISTS
428 if(substring(this.model, 0, 14) == "models/weapons")
430 if(substring(this.tag_entity.model, 0, 14) == "models/weapons")
432 this.tag_index = gettagindex(this.tag_entity, "weapon");
434 this.tag_index = gettagindex(this.tag_entity, "tag_weapon");
437 // we need to prevent this from 'appening
438 this.tag_entity = NULL;
440 LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it");
443 else if(this.tag_entity.isplayermodel)
445 skeleton_loadinfo(this.tag_entity);
446 this.tag_index = this.tag_entity.bone_weapon;
450 if(substring(this.tag_entity.model, 0, 14) == "models/weapons")
452 this.tag_index = gettagindex(this.tag_entity, "shot");
454 this.tag_index = gettagindex(this.tag_entity, "tag_shot");
457 MUTATOR_CALLHOOK(TagIndex_Apply, this);
461 // damn, see you next frame
468 void CSQCModel_Effects_PreUpdate(entity this)
470 this.effects = this.csqcmodel_effects;
471 this.modelflags = this.csqcmodel_modelflags;
472 this.traileffect = this.csqcmodel_traileffect;
474 void Reset_ArcBeam();
475 void CSQCModel_Effects_PostUpdate(entity this)
477 if (this == csqcplayer) {
478 if (this.csqcmodel_teleported) {
482 this.csqcmodel_effects = this.effects;
483 this.csqcmodel_modelflags = this.modelflags;
484 this.csqcmodel_traileffect = this.traileffect;
487 if(this.csqcmodel_teleported)
488 Projectile_ResetTrail(this, this.origin);
491 void CSQCModel_Effects_Apply(entity this)
493 int eff = this.csqcmodel_effects & ~CSQCMODEL_EF_RESPAWNGHOST;
494 int tref = this.csqcmodel_traileffect;
496 this.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
498 this.traileffect = 0;
500 if(eff & EF_BRIGHTFIELD)
501 tref = EFFECT_TR_NEXUIZPLASMA.m_id;
502 // ignoring EF_MUZZLEFLASH
503 if(eff & EF_BRIGHTLIGHT)
504 adddynamiclight(this.origin, 400, '3 3 3');
505 if(eff & EF_DIMLIGHT)
506 adddynamiclight(this.origin, 200, '1.5 1.5 1.5');
507 if((eff & EF_NODRAW) || (this.alpha < 0))
509 if(eff & EF_ADDITIVE)
510 this.renderflags |= RF_ADDITIVE;
512 adddynamiclight(this.origin, 200, '0.15 0.15 1.5');
514 adddynamiclight(this.origin, 200, '1.5 0.15 0.15');
515 // ignoring EF_NOGUNBOB
516 if(eff & EF_FULLBRIGHT)
517 this.renderflags |= RF_FULLBRIGHT;
519 pointparticles(EFFECT_EF_FLAME, this.origin, '0 0 0', bound(0, frametime, 0.1));
520 if(eff & EF_STARDUST)
521 pointparticles(EFFECT_EF_STARDUST, this.origin, '0 0 0', bound(0, frametime, 0.1));
522 if(eff & EF_NOSHADOW)
523 this.renderflags |= RF_NOSHADOW;
524 if(eff & EF_NODEPTHTEST)
525 this.renderflags |= RF_DEPTHHACK;
526 // ignoring EF_SELECTABLE
527 if(eff & EF_DOUBLESIDED)
528 this.effects |= EF_DOUBLESIDED;
529 if(eff & EF_NOSELFSHADOW)
530 this.effects |= EF_NOSELFSHADOW;
531 if(eff & EF_DYNAMICMODELLIGHT)
532 this.renderflags |= RF_DYNAMICMODELLIGHT;
533 // ignoring EF_UNUSED18, EF_UNUSED19, EF_RESTARTANIM_BIT, EF_TELEPORT_BIT, EF_LOWPRECISION
534 if(this.csqcmodel_modelflags & MF_ROCKET)
535 tref = EFFECT_TR_ROCKET.m_id;
536 if(this.csqcmodel_modelflags & MF_GRENADE)
537 tref = EFFECT_TR_GRENADE.m_id;
538 if(this.csqcmodel_modelflags & MF_GIB)
539 tref = EFFECT_TR_BLOOD.m_id;
540 if(this.csqcmodel_modelflags & MF_ROTATE)
542 this.renderflags |= RF_USEAXIS;
543 makevectors(this.angles + '0 100 0' * fmod(time, 3.6));
545 if(this.csqcmodel_modelflags & MF_TRACER)
546 tref = EFFECT_TR_WIZSPIKE.m_id;
547 if(this.csqcmodel_modelflags & MF_ZOMGIB)
548 tref = EFFECT_TR_SLIGHTBLOOD.m_id;
549 if(this.csqcmodel_modelflags & MF_TRACER2)
550 tref = EFFECT_TR_KNIGHTSPIKE.m_id;
551 if(this.csqcmodel_modelflags & MF_TRACER3)
552 tref = EFFECT_TR_VORESPIKE.m_id;
554 this.traileffect = tref;
557 Projectile_DrawTrail(this, this.origin);
559 Projectile_ResetTrail(this, this.origin);
561 if(this.csqcmodel_effects & CSQCMODEL_EF_RESPAWNGHOST)
562 this.renderflags |= RF_ADDITIVE;
563 // also special in CSQCPlayer_GlowMod_Apply
565 if(this.csqcmodel_modelflags & MF_ROCKET)
567 if(!this.snd_looping)
569 sound(this, CH_TRIGGER_SINGLE, SND_JETPACK_FLY, VOL_BASE, autocvar_cl_jetpack_attenuation);
570 this.snd_looping = CH_TRIGGER_SINGLE;
577 sound(this, this.snd_looping, SND_Null, VOL_BASE, autocvar_cl_jetpack_attenuation);
578 this.snd_looping = 0;
584 .int csqcmodel_predraw_run;
586 .int anim_frame1time;
588 .int anim_frame2time;
590 .int anim_saveframe1time;
591 .int anim_saveframe2;
592 .int anim_saveframe2time;
593 .int anim_prev_pmove_flags;
594 void CSQCModel_Hook_PreDraw(entity this, bool isplayer)
596 if(this.csqcmodel_predraw_run == framecount)
598 this.csqcmodel_predraw_run = framecount;
600 if(!this.modelindex || this.model == "null")
606 this.drawmask = MASK_NORMAL;
608 if(this.isplayermodel) // this checks if it's a player MODEL!
610 CSQCPlayer_ModelAppearance_Apply(this, this.entnum == player_localnum + 1);
611 CSQCPlayer_LOD_Apply(this);
615 skeleton_loadinfo(this);
616 bool doblend = (this.bone_upperbody >= 0);
617 CSQCPlayer_FallbackFrame_Apply(this);
620 skeleton_from_frames(this, this.csqcmodel_isdead);
624 free_skeleton_from_frames(this);
625 // just in case, clear these (we're animating in frame and frame3)
632 // we know that frame3 and frame4 fields, used by InterpolateAnimation, are left alone - but that is all we know!
633 skeleton_loadinfo(this);
634 bool doblend = (this.bone_upperbody >= 0);
636 if(this == csqcplayer)
638 if(IS_ONGROUND(this))
640 this.anim_prev_pmove_flags = this.flags;
641 if(this.flags & FL_DUCKED)
642 animdecide_setstate(this, this.anim_state | ANIMSTATE_DUCK, false);
643 else if(this.anim_state & ANIMSTATE_DUCK)
644 animdecide_setstate(this, this.anim_state - ANIMSTATE_DUCK, false);
648 tracebox(this.origin + '0 0 1', this.mins, this.maxs, this.origin - '0 0 4', MOVE_NORMAL, this);
649 if(trace_startsolid || trace_fraction < 1)
652 animdecide_load_if_needed(this);
653 animdecide_setimplicitstate(this, onground);
654 animdecide_setframes(this, doblend, anim_frame, anim_frame1time, anim_frame2, anim_frame2time);
656 if(this.anim_saveframe != this.anim_frame || this.anim_saveframe1time != this.anim_frame1time)
657 sf |= CSQCMODEL_PROPERTY_FRAME;
658 if(this.anim_saveframe2 != this.anim_frame2 || this.anim_saveframe2time != this.anim_frame2time)
659 sf |= CSQCMODEL_PROPERTY_FRAME2;
660 this.anim_saveframe = this.anim_frame;
661 this.anim_saveframe1time = this.anim_frame1time;
662 this.anim_saveframe2 = this.anim_frame2;
663 this.anim_saveframe2time = this.anim_frame2time;
664 // Note: we always consider lerpfrac "changed", as it uses fixed values every time anyway.
665 // This ensures that .frame etc. are always written.
666 CSQCModel_InterpolateAnimation_2To4_PreNote(this, sf | CSQCMODEL_PROPERTY_LERPFRAC);
667 this.lerpfrac = (doblend ? 0.5 : 0);
668 this.frame = this.anim_frame;
669 this.frame1time = this.anim_frame1time;
670 this.frame2 = this.anim_frame2;
671 this.frame2time = this.anim_frame2time;
672 CSQCModel_InterpolateAnimation_2To4_Note(this, sf | CSQCMODEL_PROPERTY_LERPFRAC, false);
673 CSQCModel_InterpolateAnimation_2To4_Do(this);
676 skeleton_from_frames(this, this.csqcmodel_isdead);
680 free_skeleton_from_frames(this);
681 // just in case, clear these (we're animating in frame and frame3)
688 CSQCModel_AutoTagIndex_Apply(this);
690 CSQCModel_Effects_Apply(this);
693 void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
695 // interpolate v_angle
696 this.iflags |= IFLAG_V_ANGLE_X;
697 // revert to values from server
698 CSQCModel_Effects_PreUpdate(this);
699 if(this.isplayermodel)
702 CSQCPlayer_FallbackFrame_PreUpdate(this);
703 CSQCPlayer_ModelAppearance_PreUpdate(this);
707 void CSQCModel_Hook_PostUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
709 // is it a player model? (shared state)
710 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)));
712 // save values set by server
713 if(this.isplayermodel)
715 CSQCPlayer_ModelAppearance_PostUpdate(this);
717 CSQCPlayer_AnimDecide_PostUpdate(this, isnew);
719 CSQCPlayer_FallbackFrame_PostUpdate(this, isnew);
721 CSQCModel_Effects_PostUpdate(this);