+
+ // GLOWMOD AND DEATH FADING
+ if(self.colormap > 0)
+ self.glowmod = colormapPaletteColor(((self.colormap >= 1024) ? self.colormap : stof(getplayerkeyvalue(self.colormap - 1, "colors"))) & 0x0F, TRUE) * 2;
+ else
+ self.glowmod = '1 1 1';
+
+ if(autocvar_cl_deathglow > 0)
+ {
+ if(self.csqcmodel_isdead)
+ {
+ // Fade out to black now...
+ if(self.old_glowmod == '0 0 0') { self.old_glowmod = self.glowmod; }
+ self.colormap = 0;
+
+ self.glowmod = self.old_glowmod * bound(0, 1 - (time - self.death_time) / autocvar_cl_deathglow, 1);
+ self.glowmod_x = max(self.glowmod_x, 0.0001);
+ self.glowmod_y = max(self.glowmod_y, 0.0001);
+ self.glowmod_z = max(self.glowmod_z, 0.0001);
+ }
+ else if(self.old_glowmod != '0 0 0') { self.old_glowmod = '0 0 0'; }
+ }
+
+ //printf("CSQCPlayer_ModelAppearance_Apply(): state = %s, colormap = %f, glowmod = %s\n", (self.csqcmodel_isdead ? "DEAD" : "ALIVE"), self.colormap, vtos(self.glowmod));