3 #include <common/anim.qh>
4 #include <common/animdecide.qh>
5 #include <common/csqcmodel_settings.qh>
6 #include <common/deathtypes/all.qh>
7 #include <common/effects/all.qh>
8 #include <common/effects/qc/_mod.qh>
9 #include <common/gamemodes/_mod.qh>
10 #include <common/gamemodes/sv_rules.qh>
11 #include <common/mapobjects/_mod.qh>
12 #include <common/mapobjects/subs.qh>
13 #include <common/mapobjects/teleporters.qh>
14 #include <common/minigames/sv_minigames.qh>
15 #include <common/mutators/mutator/waypoints/waypointsprites.qh>
16 #include <common/physics/player.qh>
17 #include <common/playerstats.qh>
18 #include <common/state.qh>
19 #include <common/wepent.qh>
20 #include <lib/csqcmodel/sv_model.qh>
21 #include <server/bot/api.qh>
22 #include <server/cheats.qh>
23 #include <server/client.qh>
24 #include <server/clientkill.qh>
25 #include <server/command/common.qh>
26 #include <server/command/vote.qh>
27 #include <server/damage.qh>
28 #include <server/handicap.qh>
29 #include <server/hook.qh>
30 #include <server/main.qh>
31 #include <server/mutators/_mod.qh>
32 #include <server/portals.qh>
33 #include <server/teamplay.qh>
34 #include <server/weapons/accuracy.qh>
35 #include <server/weapons/common.qh>
36 #include <server/weapons/throwing.qh>
37 #include <server/weapons/weaponstats.qh>
38 #include <server/weapons/weaponsystem.qh>
39 #include <server/world.qh>
41 void Drop_Special_Items(entity player)
43 // called when the player has become stuck or frozen
44 // so objective items aren't stuck with the player
46 MUTATOR_CALLHOOK(DropSpecialItems, player);
49 void CopyBody_Think(entity this)
51 if(this.CopyBody_nextthink && time > this.CopyBody_nextthink)
53 this.CopyBody_think(this);
56 this.CopyBody_nextthink = this.nextthink;
57 this.CopyBody_think = getthink(this);
58 setthink(this, CopyBody_Think);
60 CSQCMODEL_AUTOUPDATE(this);
61 this.nextthink = time;
63 void CopyBody(entity this, float keepvelocity)
65 if (this.effects & EF_NODRAW)
67 entity clone = new(body);
70 clone.colormap = this.colormap;
71 clone.iscreature = this.iscreature;
72 clone.teleportable = this.teleportable;
73 clone.damagedbycontents = this.damagedbycontents;
74 if(clone.damagedbycontents)
75 IL_PUSH(g_damagedbycontents, clone);
76 clone.angles = this.angles;
77 clone.v_angle = this.v_angle;
78 clone.avelocity = this.avelocity;
79 clone.damageforcescale = this.damageforcescale;
80 clone.effects = this.effects;
81 clone.glowmod = this.glowmod;
82 clone.event_damage = this.event_damage;
83 clone.event_heal = this.event_heal;
84 clone.anim_state = this.anim_state;
85 clone.anim_time = this.anim_time;
86 clone.anim_lower_action = this.anim_lower_action;
87 clone.anim_lower_time = this.anim_lower_time;
88 clone.anim_upper_action = this.anim_upper_action;
89 clone.anim_upper_time = this.anim_upper_time;
90 clone.anim_implicit_state = this.anim_implicit_state;
91 clone.anim_implicit_time = this.anim_implicit_time;
92 clone.anim_lower_implicit_action = this.anim_lower_implicit_action;
93 clone.anim_lower_implicit_time = this.anim_lower_implicit_time;
94 clone.anim_upper_implicit_action = this.anim_upper_implicit_action;
95 clone.anim_upper_implicit_time = this.anim_upper_implicit_time;
96 clone.dphitcontentsmask = this.dphitcontentsmask;
97 clone.death_time = this.death_time;
98 clone.pain_finished = this.pain_finished;
99 SetResourceExplicit(clone, RES_HEALTH, GetResource(this, RES_HEALTH));
100 SetResourceExplicit(clone, RES_ARMOR, GetResource(this, RES_ARMOR));
101 clone.armortype = this.armortype;
102 clone.model = this.model;
103 clone.modelindex = this.modelindex;
104 clone.skin = this.skin;
105 clone.species = this.species;
106 clone.move_qcphysics = false; // don't run gamecode logic on clones, too many
107 set_movetype(clone, this.move_movetype);
108 clone.solid = this.solid;
109 clone.takedamage = this.takedamage;
110 setcefc(clone, getcefc(this));
111 clone.uncustomizeentityforclient = this.uncustomizeentityforclient;
112 clone.uncustomizeentityforclient_set = this.uncustomizeentityforclient_set;
113 if (keepvelocity == 1)
114 clone.velocity = this.velocity;
115 clone.oldvelocity = clone.velocity;
116 clone.alpha = this.alpha;
117 clone.fade_time = this.fade_time;
118 clone.fade_rate = this.fade_rate;
119 //clone.weapon = this.weapon;
120 setorigin(clone, this.origin);
121 setsize(clone, this.mins, this.maxs);
122 clone.reset = SUB_Remove;
123 clone._ps = this._ps;
125 Drag_MoveDrag(this, clone);
127 if(clone.colormap <= maxclients && clone.colormap > 0)
128 clone.colormap = 1024 + this.clientcolors;
130 CSQCMODEL_AUTOINIT(clone);
131 clone.CopyBody_nextthink = this.nextthink;
132 clone.CopyBody_think = getthink(this);
133 clone.nextthink = time;
134 setthink(clone, CopyBody_Think);
135 // "bake" the current animation frame for clones (they don't get clientside animation)
136 animdecide_load_if_needed(clone);
137 animdecide_setframes(clone, false, frame, frame1time, frame2, frame2time);
139 IL_PUSH(g_clones, clone);
141 MUTATOR_CALLHOOK(CopyBody, this, clone, keepvelocity);
144 void player_setupanimsformodel(entity this)
146 // load animation info
147 animdecide_load_if_needed(this);
148 animdecide_setstate(this, 0, false);
151 void player_anim(entity this)
153 int deadbits = (this.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2));
156 // Decide on which death animation to use.
158 deadbits = ANIMSTATE_DEAD1;
160 deadbits = ANIMSTATE_DEAD2;
163 // Clear a previous death animation.
166 int animbits = deadbits;
167 if(STAT(FROZEN, this))
168 animbits |= ANIMSTATE_FROZEN;
169 if(this.move_movetype == MOVETYPE_FOLLOW)
170 animbits |= ANIMSTATE_FOLLOW;
172 animbits |= ANIMSTATE_DUCK;
173 animdecide_setstate(this, animbits, false);
174 animdecide_setimplicitstate(this, IS_ONGROUND(this));
177 void PlayerCorpseDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
181 Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, this, attacker);
183 v = healtharmor_applydamage(GetResource(this, RES_ARMOR), autocvar_g_balance_armor_blockpercent, deathtype, damage);
187 if(sound_allowed(MSG_BROADCAST, attacker))
190 sound (this, CH_SHOTS, SND_ARMORIMPACT, VOL_BASE, ATTEN_NORM);
192 sound (this, CH_SHOTS, SND_BODYIMPACT2, VOL_BASE, ATTEN_NORM);
194 sound (this, CH_SHOTS, SND_BODYIMPACT1, VOL_BASE, ATTEN_NORM);
198 Violence_GibSplash_At(hitloc, force * -0.1, 3, 1, this, attacker);
200 Violence_GibSplash_At(hitloc, force * -0.2, 3, 1, this, attacker);
202 TakeResource(this, RES_ARMOR, save);
203 TakeResource(this, RES_HEALTH, take);
204 // pause regeneration for 5 seconds
205 this.pauseregen_finished = max(this.pauseregen_finished, time + autocvar_g_balance_pause_health_regen);
207 this.dmg_save = this.dmg_save + save;//max(save - 10, 0);
208 this.dmg_take = this.dmg_take + take;//max(take - 10, 0);
209 this.dmg_inflictor = inflictor;
211 if (GetResource(this, RES_HEALTH) <= -autocvar_sv_gibhealth && this.alpha >= 0)
213 // don't use any animations as a gib
215 // view just above the floor
216 this.view_ofs = '0 0 4';
218 Violence_GibSplash(this, 1, 1, attacker);
220 this.solid = SOLID_NOT; // restore later
221 this.takedamage = DAMAGE_NO; // restore later
222 if(this.damagedbycontents)
223 IL_REMOVE(g_damagedbycontents, this);
224 this.damagedbycontents = false;
228 void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
231 float initial_health = max(GetResource(this, RES_HEALTH), 0);
232 float initial_armor = max(GetResource(this, RES_ARMOR), 0);
233 float take = 0, save = 0;
237 if(!DEATH_ISSPECIAL(deathtype))
239 damage *= Handicap_GetTotalHandicap(this);
240 if (this != attacker && IS_PLAYER(attacker))
242 damage /= Handicap_GetTotalHandicap(attacker);
246 if (STAT(FROZEN, this))
248 if (!ITEM_DAMAGE_NEEDKILL(deathtype))
251 else if (time < this.spawnshieldtime && autocvar_g_spawnshield_blockdamage < 1)
252 damage *= 1 - bound(0, autocvar_g_spawnshield_blockdamage, 1);
254 if(deathtype & HITTYPE_SOUND) // sound based attacks cause bleeding from the ears
260 ear1_z += 0.125 * this.view_ofs.z + 0.875 * this.maxs.z; // 7/8
262 makevectors(this.angles);
263 ear1 += v_right * -10;
264 ear2 += v_right * +10;
265 d = inflictor.origin - this.origin;
267 f = (d * v_right) / vlen(d); // this is cos of angle of d and v_right!
269 f = 0; // Assum ecenter.
270 force = v_right * vlen(force);
271 Violence_GibSplash_At(ear1, force * -1, 2, bound(0, damage, 25) / 2 * (0.5 - 0.5 * f), this, attacker);
272 Violence_GibSplash_At(ear2, force, 2, bound(0, damage, 25) / 2 * (0.5 + 0.5 * f), this, attacker);
281 // force is already good
285 Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, this, attacker);
287 v = healtharmor_applydamage(GetResource(this, RES_ARMOR), autocvar_g_balance_armor_blockpercent, deathtype, damage);
294 // don't reset pushltime for self damage as it may be an attempt to
295 // escape a lava pit or similar
296 //this.pushltime = 0;
299 else if(IS_PLAYER(attacker))
301 this.pusher = attacker;
302 this.pushltime = time + autocvar_g_maxpushtime;
303 this.istypefrag = PHYS_INPUT_BUTTON_CHAT(this);
305 else if(time < this.pushltime)
307 attacker = this.pusher;
308 this.pushltime = max(this.pushltime, time + 0.6);
316 MUTATOR_CALLHOOK(PlayerDamage_SplitHealthArmor, inflictor, attacker, this, force, take, save, deathtype, damage);
317 take = bound(0, M_ARGV(4, float), GetResource(this, RES_HEALTH));
318 save = bound(0, M_ARGV(5, float), GetResource(this, RES_ARMOR));
319 float excess = max(0, damage - take - save);
321 if(sound_allowed(MSG_BROADCAST, attacker))
323 if (save > 10 && (initial_health - take) > 0) // don't play armor sound if the attack is fatal
324 sound (this, CH_SHOTS, SND_ARMORIMPACT, VOL_BASE, ATTEN_NORM);
326 sound (this, CH_SHOTS, SND_BODYIMPACT2, VOL_BASE, ATTEN_NORM);
328 sound (this, CH_SHOTS, SND_BODYIMPACT1, VOL_BASE, ATTEN_NORM); // FIXME possibly remove them?
332 Violence_GibSplash_At(hitloc, force * -0.1, 3, 1, this, attacker);
334 Violence_GibSplash_At(hitloc, force * -0.2, 3, 1, this, attacker);
336 if (time >= this.spawnshieldtime || autocvar_g_spawnshield_blockdamage < 1)
338 if (!(this.flags & FL_GODMODE))
340 TakeResource(this, RES_ARMOR, save);
341 TakeResource(this, RES_HEALTH, take);
342 // pause regeneration for 5 seconds
344 this.pauseregen_finished = max(this.pauseregen_finished, time + autocvar_g_balance_pause_health_regen);
346 if (time > this.pain_finished && !STAT(FROZEN, this)) // Don't switch pain sequences like crazy
348 this.pain_finished = time + 0.5; //Supajoe
350 if(autocvar_sv_gentle < 1) {
351 if(this.classname != "body") // pain anim is BORKED on our ZYMs, FIXME remove this once we have good models
353 if (!this.animstate_override)
356 animdecide_setaction(this, ANIMACTION_PAIN1, true);
358 animdecide_setaction(this, ANIMACTION_PAIN2, true);
361 float myhp = GetResource(this, RES_HEALTH);
363 if(myhp < 25 || !(DEATH_WEAPONOF(deathtype).spawnflags & WEP_FLAG_CANCLIMB) || take > 20 || attacker != this)
364 if(sound_allowed(MSG_BROADCAST, attacker))
365 // exclude pain sounds for laserjumps as long as you aren't REALLY low on health and would die of the next two
367 if(deathtype == DEATH_FALL.m_id)
368 PlayerSound(this, playersound_fall, CH_PAIN, VOL_BASE, VOICETYPE_PLAYERSOUND);
370 PlayerSound(this, playersound_pain100, CH_PAIN, VOL_BASE, VOICETYPE_PLAYERSOUND);
372 PlayerSound(this, playersound_pain75, CH_PAIN, VOL_BASE, VOICETYPE_PLAYERSOUND);
374 PlayerSound(this, playersound_pain50, CH_PAIN, VOL_BASE, VOICETYPE_PLAYERSOUND);
376 PlayerSound(this, playersound_pain25, CH_PAIN, VOL_BASE, VOICETYPE_PLAYERSOUND);
381 // throw off bot aim temporarily
383 if(IS_BOT_CLIENT(this) && GetResource(this, RES_HEALTH) >= 1)
385 shake = damage * 5 / (bound(0,skill,100) + 1);
386 this.v_angle_x = this.v_angle.x + (random() * 2 - 1) * shake;
387 this.v_angle_y = this.v_angle.y + (random() * 2 - 1) * shake;
388 this.v_angle_x = bound(-90, this.v_angle.x, 90);
392 this.max_armorvalue += (save + take);
394 this.dmg_save = this.dmg_save + save;//max(save - 10, 0);
395 this.dmg_take = this.dmg_take + take;//max(take - 10, 0);
396 this.dmg_inflictor = inflictor;
398 bool abot = (IS_BOT_CLIENT(attacker));
399 bool vbot = (IS_BOT_CLIENT(this));
401 bool valid_damage_for_weaponstats = false;
402 Weapon awep = WEP_Null;
404 if (!(round_handler_IsActive() && !round_handler_IsRoundStarted()) && time >= game_starttime)
405 if(vbot || IS_REAL_CLIENT(this))
406 if(abot || IS_REAL_CLIENT(attacker))
407 if(attacker && this != attacker)
408 if (DIFF_TEAM(this, attacker) && (!STAT(FROZEN, this) || this.freeze_time > time))
410 if(DEATH_ISSPECIAL(deathtype))
411 awep = attacker.(weaponentity).m_weapon;
413 awep = DEATH_WEAPONOF(deathtype);
414 valid_damage_for_weaponstats = true;
417 float dh = initial_health - max(GetResource(this, RES_HEALTH), 0); // health difference
418 float da = initial_armor - max(GetResource(this, RES_ARMOR), 0); // armor difference
419 if(valid_damage_for_weaponstats)
421 WeaponStats_LogDamage(awep.m_id, abot, this.(weaponentity).m_weapon.m_id, vbot, dh + da);
424 bool forbid_logging_damage = MUTATOR_CALLHOOK(PlayerDamaged, attacker, this, dh, da, hitloc, deathtype, damage);
426 if ((dh || da) && !forbid_logging_damage)
428 float realdmg = damage - excess;
429 if ((this != attacker || deathtype == DEATH_KILL.m_id) && realdmg && !STAT(FROZEN, this)
430 && (!(round_handler_IsActive() && !round_handler_IsRoundStarted()) && time >= game_starttime))
432 if (IS_PLAYER(attacker) && DIFF_TEAM(attacker, this) && deathtype != DEATH_KILL.m_id)
433 GameRules_scoring_add(attacker, DMG, realdmg);
435 GameRules_scoring_add(this, DMGTAKEN, realdmg);
439 if (GetResource(this, RES_HEALTH) < 1)
441 bool defer_ClientKill_Now_TeamChange = false;
445 PlayerStats_GameReport_Event_Player(this, PLAYERSTATS_ALIVETIME, time - this.alivetime);
449 if(valid_damage_for_weaponstats)
450 WeaponStats_LogKill(awep.m_id, abot, this.(weaponentity).m_weapon.m_id, vbot);
452 if(autocvar_sv_gentle < 1)
453 if(sound_allowed(MSG_BROADCAST, attacker))
455 if(deathtype == DEATH_DROWN.m_id)
456 PlayerSound(this, playersound_drown, CH_PAIN, VOL_BASE, VOICETYPE_PLAYERSOUND);
458 PlayerSound(this, playersound_death, CH_PAIN, VOL_BASE, VOICETYPE_PLAYERSOUND);
461 // get rid of kill indicator
462 if(this.killindicator)
464 delete(this.killindicator);
465 this.killindicator = NULL;
466 if(this.killindicator_teamchange)
467 defer_ClientKill_Now_TeamChange = true;
469 if(this.classname == "body")
470 if(deathtype == DEATH_KILL.m_id)
472 // for the lemmings fans, a small harmless explosion
473 Send_Effect(EFFECT_ROCKET_EXPLODE, this.origin, '0 0 0', 1);
477 // print an obituary message
478 if(this.classname != "body")
479 Obituary(attacker, inflictor, this, deathtype, weaponentity);
481 // increment frag counter for used weapon type
482 Weapon w = DEATH_WEAPONOF(deathtype);
483 if(w != WEP_Null && accuracy_isgooddamage(attacker, this))
484 CS(attacker).accuracy.(accuracy_frags[w.m_id-1]) += 1;
486 this.respawn_time = 0;
487 MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype, damage);
488 damage = M_ARGV(4, float);
489 excess = max(0, damage - take - save);
491 //Weapon wep = this.(weaponentity).m_weapon;
492 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
494 .entity went = weaponentities[slot];
496 continue; // TODO: clones have no weapon, but we don't want to have to check this all the time
497 Weapon wep = this.(went).m_weapon;
498 wep.wr_playerdeath(wep, this, went);
501 RemoveGrapplingHooks(this);
503 Portal_ClearAllLater(this);
505 this.fixangle = true;
507 if(defer_ClientKill_Now_TeamChange)
508 ClientKill_Now_TeamChange(this); // can turn player into spectator
510 // player could have been miraculously resuscitated ;)
511 // e.g. players in freezetag get frozen, they don't really die
512 if(GetResource(this, RES_HEALTH) >= 1 || !(IS_PLAYER(this) || this.classname == "body"))
515 if (!this.respawn_time) // can be set in the mutator hook PlayerDies
516 calculate_player_respawn_time(this);
518 // when we get here, player actually dies
520 Unfreeze(this, false); // remove any icy remains
523 WaypointSprite_PlayerDead(this);
525 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
527 .entity went = weaponentities[slot];
528 SpawnThrownWeapon(this, this.origin + (this.mins + this.maxs) * 0.5, this.(went).m_weapon, went);
531 // become fully visible
532 this.alpha = default_player_alpha;
533 // make the corpse upright (not tilted)
537 this.avelocity = '0 0 0';
538 // view from the floor
539 this.view_ofs = '0 0 -8';
540 if(this.move_movetype == MOVETYPE_NOCLIP)
542 // don't toss the corpse in this case, it can get stuck in solid (causing low fps)
543 // or fall indefinitely into the void if out of the map
544 this.velocity = '0 0 0';
549 set_movetype(this, MOVETYPE_TOSS);
552 this.solid = SOLID_CORPSE;
553 PS(this).ballistics_density = autocvar_g_ballistics_density_corpse;
554 // don't stick to the floor
555 UNSET_ONGROUND(this);
557 this.deadflag = DEAD_DYING;
558 // don't play teleportation sounds
559 this.teleportable = TELEPORT_SIMPLE;
561 STAT(STRENGTH_FINISHED, this) = 0;
562 STAT(INVINCIBLE_FINISHED, this) = 0;
563 STAT(SUPERWEAPONS_FINISHED, this) = 0;
564 STAT(AIR_FINISHED, this) = 0;
566 this.death_time = time;
568 animdecide_setstate(this, this.anim_state | ANIMSTATE_DEAD1, true);
570 animdecide_setstate(this, this.anim_state | ANIMSTATE_DEAD2, true);
572 // set damage function to corpse damage
573 this.event_damage = PlayerCorpseDamage;
574 this.event_heal = func_null;
575 // call the corpse damage function just in case it wants to gib
576 this.event_damage(this, inflictor, attacker, excess, deathtype, weaponentity, hitloc, force);
578 // set up to fade out later
579 SUB_SetFade (this, time + 6 + random (), 1);
580 // reset body think wrapper broken by SUB_SetFade
581 if(this.classname == "body" && getthink(this) != CopyBody_Think) {
582 this.CopyBody_think = getthink(this);
583 this.CopyBody_nextthink = this.nextthink;
584 setthink(this, CopyBody_Think);
585 this.nextthink = time;
588 if(autocvar_sv_gentle > 0 || autocvar_ekg || this.classname == "body") {
590 // clones don't run any animation code any more, so we must gib them when they die :(
591 this.event_damage(this, inflictor, attacker, autocvar_sv_gibhealth + 1, deathtype, weaponentity, hitloc, force);
594 // reset fields the weapons may use just in case
595 if(this.classname != "body")
597 FOREACH(Weapons, it != WEP_Null,
599 it.wr_resetplayer(it, this);
600 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
602 ATTACK_FINISHED_FOR(this, it.m_id, slot) = 0;
606 MUTATOR_CALLHOOK(PlayerDied, this);
610 bool PlayerHeal(entity targ, entity inflictor, float amount, float limit)
612 if(GetResource(targ, RES_HEALTH) <= 0 || GetResource(targ, RES_HEALTH) >= limit)
615 GiveResourceWithLimit(targ, RES_HEALTH, amount, limit);
619 void precache_playermodel(string m)
621 int globhandle, i, n;
624 // remove :<skinnumber> suffix
625 int j = strstrofs(m, ":", 0);
627 m = substring(m, 0, j);
629 if(substring(m, -9, 5) == "_lod1")
631 if(substring(m, -9, 5) == "_lod2")
634 f = strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1));
637 f = strcat(substring(m, 0, -5), "_lod2", substring(m, -4, -1));
641 globhandle = search_begin(strcat(m, "_*.sounds"), true, false);
644 n = search_getsize(globhandle);
645 for (i = 0; i < n; ++i)
647 //print(search_getfilename(globhandle, i), "\n");
648 f = search_getfilename(globhandle, i);
649 PrecachePlayerSounds(f);
651 search_end(globhandle);
653 void precache_all_playermodels(string pattern)
655 int globhandle = search_begin(pattern, true, false);
656 if (globhandle < 0) return;
657 int n = search_getsize(globhandle);
658 for (int i = 0; i < n; ++i)
660 string s = search_getfilename(globhandle, i);
661 precache_playermodel(s);
663 search_end(globhandle);
666 void precache_playermodels(string s)
668 FOREACH_WORD(s, true, { precache_playermodel(it); });
671 PRECACHE(PlayerModels)
673 // Precache all player models if desired
674 if (autocvar_sv_precacheplayermodels)
676 PrecachePlayerSounds("sound/player/default.sounds");
677 precache_all_playermodels("models/player/*.zym");
678 precache_all_playermodels("models/player/*.dpm");
679 precache_all_playermodels("models/player/*.md3");
680 precache_all_playermodels("models/player/*.psk");
681 precache_all_playermodels("models/player/*.iqm");
684 if (autocvar_sv_defaultcharacter)
686 precache_playermodels(autocvar_sv_defaultplayermodel_red);
687 precache_playermodels(autocvar_sv_defaultplayermodel_blue);
688 precache_playermodels(autocvar_sv_defaultplayermodel_yellow);
689 precache_playermodels(autocvar_sv_defaultplayermodel_pink);
690 precache_playermodels(autocvar_sv_defaultplayermodel);