From: TimePath Date: Mon, 2 Nov 2015 05:02:51 +0000 (+1100) Subject: Viewmodel: mimic player model effects X-Git-Tag: xonotic-v0.8.2~1601^2~19 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=3e5bd9a991152c2572cd696570ce4ab0fc2c6ce1 Viewmodel: mimic player model effects --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 3333687ee1..95167a1c4c 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()); } }