From: Mario Date: Sun, 30 Jul 2017 04:03:26 +0000 (+1000) Subject: Add a mutator hook to disable model/color forcing X-Git-Tag: xonotic-v0.8.5~2553 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=aefd2a536a3de072eeb74af99350e4e06e5fe4a5;p=xonotic%2Fxonotic-data.pk3dir.git Add a mutator hook to disable model/color forcing --- diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index d2b28e9b0..e27557cf4 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -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; diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index 0fa65d28e..b3c0b0dfb 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -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);