]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a mutator hook to disable model/color forcing
authorMario <mario@smbclan.net>
Sun, 30 Jul 2017 04:03:26 +0000 (14:03 +1000)
committerMario <mario@smbclan.net>
Sun, 30 Jul 2017 04:03:26 +0000 (14:03 +1000)
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/mutators/events.qh

index d2b28e9b08f2a9b4cacd3a49bc0f45076a52de8e..e27557cf451446f3e6c722c664ba7a28d750d487 100644 (file)
@@ -134,6 +134,9 @@ void CSQCPlayer_ModelAppearance_PostUpdate(entity this)
 }
 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 +281,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;
index 0fa65d28ef75d2270450ea2028feda07a3d19c06..b3c0b0dfbfcf484f292292f8554125c7c154b889 100644 (file)
@@ -179,3 +179,10 @@ MUTATOR_HOOKABLE(DrawViewModel, EV_DrawViewModel);
 
 /** Called when updating the view's liquid contents, return true to disable the standard checks and apply your own */
 MUTATOR_HOOKABLE(HUD_Contents, EV_NO_ARGS);
+
+/** Return true to disable player model/color forcing */
+#define EV_ForcePlayermodels_Skip(i, o) \
+       /** entity id */                i(entity, MUTATOR_ARGV_0_entity) \
+       /** is local */                 i(bool, MUTATOR_ARGV_1_bool) \
+       /**/
+MUTATOR_HOOKABLE(ForcePlayermodels_Skip, EV_ForcePlayermodels_Skip);