Saturation should depend on the configured max armor. It will now read the server...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 8 Jul 2011 15:25:15 +0000 (18:25 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 8 Jul 2011 15:25:15 +0000 (18:25 +0300)
data/qcsrc/client/Main.qc
data/qcsrc/client/View.qc
data/qcsrc/client/main.qh
data/qcsrc/server/cl_client.qc

index e4fadc5..e96c53b 100644 (file)
@@ -1035,7 +1035,7 @@ void Ent_Init()
        g_vore = ReadCoord();\r
        g_balance_vore_swallow_limit = ReadCoord();\r
 \r
-       armor_enabled = ReadByte();\r
+       armor_max = ReadCoord();\r
 \r
        if(!postinit)\r
                PostInit();\r
index e6f9a56..ae594dc 100644 (file)
@@ -811,12 +811,12 @@ void CSQC_UpdateView(float w, float h)
        if(cvar("hud_postprocessing"))\r
        {\r
                // change saturation based on the amount of armor we have\r
-               // ranges between 0 and 50 armor. 0 armor is saturation 0.5, and 0.5 armor or above is saturation 1\r
+               // ranges between 0.5 and 1 saturation, over 0 armor and half the armor limit\r
 \r
-               if(cvar("hud_saturation") && armor_enabled && spectatee_status != -1 && getstati(STAT_HEALTH) > 0)\r
+               if(cvar("hud_saturation") && armor_max && spectatee_status != -1 && getstati(STAT_HEALTH) > 0)\r
                {\r
                        float saturation;\r
-                       saturation = 0.5 + (getstati(STAT_ARMOR) * 1 * 0.01);\r
+                       saturation = 0.5 + (getstati(STAT_ARMOR) / armor_max);\r
                        saturation = bound(0, saturation, 1);\r
 \r
                        if(cvar("r_glsl_saturation") != saturation)\r
index 68bc230..a158bf2 100644 (file)
@@ -168,7 +168,7 @@ float g_weaponswitchdelay;
 \r
 float g_vore;\r
 float g_balance_vore_swallow_limit;\r
-float armor_enabled;\r
+float armor_max;\r
 \r
 //hooks\r
 float calledhooks;\r
index ef0e2db..66b11a0 100644 (file)
@@ -1046,10 +1046,10 @@ float ClientInit_SendEntity(entity to, float sf)
        WriteCoord(MSG_ENTITY, g_balance_vore_swallow_limit);\r
 \r
        // tell the client if this server uses armor\r
-       float armor_enabled;\r
+       float armor_max;\r
        if(cvar("g_balance_armor_start") || (cvar("g_lms") && cvar("g_lms_start_armor")) /*|| (inWarmupStage && cvar("g_warmup_start_armor"))*/ || cvar("g_balance_armor_regen") || cvar("g_balance_armor_regenlinear"))\r
-               armor_enabled = TRUE;\r
-       WriteByte(MSG_ENTITY, armor_enabled);\r
+               armor_max = cvar("g_balance_armor_limit");\r
+       WriteCoord(MSG_ENTITY, armor_max);\r
 \r
        return TRUE;\r
 }\r