]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
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 e4fadc50ff3906e52edf2c3101f304e0fbe03654..e96c53b524adaa13fc19b1bf40d72ecf2ef697bd 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 e6f9a562a584045863c29ea27dd471b2ce5d24e6..ae594dc83637c42a7f4f903864ed6dd4945e756f 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 68bc2300f2015b5e38b0590a4a4c8ced382b3564..a158bf27f443471ea95ce4fe5e864fefb1482600 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 ef0e2db067f0997ce75c0647f4884ee18ee7ec05..66b11a02e0b42a531d48e7bd225d4278f683f945 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