From 3e5bd9a991152c2572cd696570ce4ab0fc2c6ce1 Mon Sep 17 00:00:00 2001 From: TimePath Date: Mon, 2 Nov 2015 16:02:51 +1100 Subject: [PATCH] Viewmodel: mimic player model effects --- qcsrc/client/view.qc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 3333687ee..95167a1c4 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -30,16 +30,24 @@ #include "../lib/warpzone/client.qh" #include "../lib/warpzone/common.qh" +#define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOSHADOW | EF_SELECTABLE | EF_TELEPORT_BIT) + void viewmodel_draw(entity this) { - int mask = (intermission || (getstati(STAT_HEALTH) <= 0)) ? 0 : MASK_NORMAL; + int mask = (intermission || (getstati(STAT_HEALTH) <= 0) || autocvar_chase_active) ? 0 : MASK_NORMAL; int c = stof(getplayerkeyvalue(current_player, "colors")); vector g = colormapPaletteColor(c & 0x0F, true) * 2; + entity me = CSQCModel_server2csqc(player_localentnum); + int fx = ((me.csqcmodel_effects & EFMASK_CHEAP) + | EF_NODEPTHTEST) + &~ (EF_FULLBRIGHT); // can mask team color, so get rid of it for (entity e = this; e; e = e.weaponchild) { e.drawmask = mask; e.colormap = c; e.glowmod = g; + e.csqcmodel_effects = fx; + WITH(entity, self, e, CSQCModel_Effects_Apply()); } } -- 2.39.2