]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Take armor into consideration for the crosshair color by health
authorMario <mario@smbclan.net>
Sat, 25 Nov 2017 10:26:31 +0000 (20:26 +1000)
committerMario <mario@smbclan.net>
Sat, 25 Nov 2017 10:26:31 +0000 (20:26 +1000)
qcsrc/client/view.qc

index 7a054606313f1e64d90b61105c2ae98683a909b9..8b44f04172eae6337fb49f08c22acf350ea3e6e3 100644 (file)
@@ -910,7 +910,8 @@ vector crosshair_getcolor(entity this, float health_stat)
 
                case 2: // crosshair_color_by_health
                {
-                       float hp = health_stat;
+                       vector v = healtharmor_maxdamage(health_stat, STAT(ARMOR), armorblockpercent, DEATH_WEAPON.m_id);
+                       float hp = floor(v.x + 1);
 
                        //x = red
                        //y = green