#include "csqcmodel_hooks.qh"
-#include "mutators/events.qh"
+#include "autocvars.qh"
+#include "csqcmodel_hooks.qh"
+#include "miscfunctions.qh"
+#include <client/mutators/_mod.qh>
#include "player_skeleton.qh"
#include "weapons/projectile.qh"
#include <common/animdecide.qh>
+#include <common/ent_cs.qh>
#include <common/physics/movetypes/movetypes.qh>
#include <common/viewloc.qh>
+#include <common/effects/all.qh>
+#include <common/effects/all.inc>
#include <lib/csqcmodel/cl_model.qh>
#include <lib/csqcmodel/cl_player.qh>
#include <lib/csqcmodel/interpolate.qh>
.float death_time;
.int modelflags;
-void CSQCModel_Hook_PreDraw(entity this, bool isplayer);
-
.bool isplayermodel;
// FEATURE: LOD
this.forceplayermodels_isgoodmodel = fexists(this.forceplayermodels_savemodel);
this.forceplayermodels_isgoodmodel_mdl = this.forceplayermodels_savemodel;
if(!this.forceplayermodels_isgoodmodel)
- LOG_INFOF("Warning: missing model %s has been used\n", this.forceplayermodels_savemodel);
+ LOG_INFOF("Warning: missing model %s has been used", this.forceplayermodels_savemodel);
}
}
void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
{
+ if(MUTATOR_CALLHOOK(ForcePlayermodels_Skip, this, islocalplayer))
+ goto skipforcemodels;
+
// FORCEMODEL
// which one is ALWAYS good?
if (!forceplayermodels_goodmodel)
bool isfriend;
int cm;
cm = this.forceplayermodels_savecolormap;
- cm = (cm >= 1024) ? cm : (stof(getplayerkeyvalue(cm - 1, "colors")) + 1024);
+ cm = (cm >= 1024) ? cm : (entcs_GetClientColors(cm - 1) + 1024);
if(teamplay)
isfriend = (cm == 1024 + 17 * myteam);
this.colormap = player_localnum + 1;
}
+ LABEL(skipforcemodels)
+
// GLOWMOD AND DEATH FADING
if(this.colormap > 0)
- this.glowmod = colormapPaletteColor(((this.colormap >= 1024) ? this.colormap : stof(getplayerkeyvalue(this.colormap - 1, "colors"))) & 0x0F, true) * 2;
+ this.glowmod = colormapPaletteColor(((this.colormap >= 1024) ? this.colormap : entcs_GetClientColors(this.colormap - 1)) & 0x0F, true) * 2;
else
this.glowmod = '1 1 1';
}
int CSQCPlayer_FallbackFrame(entity this, int f)
{
- TC(int, f);
+ TC(int, f);
if(frameduration(this.modelindex, f) > 0)
return f; // goooooood
if(frameduration(this.modelindex, 1) <= 0)
if(this.tag_entity && wasfreed(this.tag_entity))
this.tag_entity = NULL;
- viewloc_SetTags(this);
-
MUTATOR_CALLHOOK(TagIndex_Update, this);
if(this.tag_networkentity)
{
if(!this.snd_looping)
{
- sound(this, CH_TRIGGER_SINGLE, SND_JETPACK_FLY, VOL_BASE, autocvar_g_jetpack_attenuation);
+ sound(this, CH_TRIGGER_SINGLE, SND_JETPACK_FLY, VOL_BASE, autocvar_cl_jetpack_attenuation);
this.snd_looping = CH_TRIGGER_SINGLE;
}
}
{
if(this.snd_looping)
{
- sound(this, this.snd_looping, SND_Null, VOL_BASE, autocvar_g_jetpack_attenuation);
+ sound(this, this.snd_looping, SND_Null, VOL_BASE, autocvar_cl_jetpack_attenuation);
this.snd_looping = 0;
}
}