]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/csqcmodel_hooks.qc
Properly support team field on trigger_multiple
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / csqcmodel_hooks.qc
index 0643bb09d5b37e3bdd7b014f13964959ab837484..6499a683e8f4c2cf198be39cb0bee2c9eb9e9a3f 100644 (file)
@@ -1,4 +1,7 @@
 #include "csqcmodel_hooks.qh"
+#include "autocvars.qh"
+#include "csqcmodel_hooks.qh"
+#include "miscfunctions.qh"
 #include "mutators/events.qh"
 #include "player_skeleton.qh"
 #include "weapons/projectile.qh"
@@ -6,6 +9,8 @@
 #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>
@@ -129,11 +134,14 @@ void CSQCPlayer_ModelAppearance_PostUpdate(entity this)
                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)
@@ -278,6 +286,8 @@ void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
                        this.colormap = player_localnum + 1;
        }
 
+       LABEL(skipforcemodels)
+
        // GLOWMOD AND DEATH FADING
        if(this.colormap > 0)
                this.glowmod = colormapPaletteColor(((this.colormap >= 1024) ? this.colormap : entcs_GetClientColors(this.colormap - 1)) & 0x0F, true) * 2;
@@ -392,8 +402,6 @@ void CSQCModel_AutoTagIndex_Apply(entity this)
        if(this.tag_entity && wasfreed(this.tag_entity))
                this.tag_entity = NULL;
 
-       viewloc_SetTags(this);
-
        MUTATOR_CALLHOOK(TagIndex_Update, this);
 
        if(this.tag_networkentity)
@@ -563,7 +571,7 @@ void CSQCModel_Effects_Apply(entity this)
        {
                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;
                }
        }
@@ -571,7 +579,7 @@ void CSQCModel_Effects_Apply(entity this)
        {
                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;
                }
        }