From 1bdc54a20f67699a353609e46e6174cf6dc90d82 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Fri, 8 Jul 2011 18:25:15 +0300 Subject: [PATCH] Saturation should depend on the configured max armor. It will now read the server side armor limit, and lower saturation when current armor is half that value or below. --- data/qcsrc/client/Main.qc | 2 +- data/qcsrc/client/View.qc | 6 +++--- data/qcsrc/client/main.qh | 2 +- data/qcsrc/server/cl_client.qc | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/data/qcsrc/client/Main.qc b/data/qcsrc/client/Main.qc index e4fadc50..e96c53b5 100644 --- a/data/qcsrc/client/Main.qc +++ b/data/qcsrc/client/Main.qc @@ -1035,7 +1035,7 @@ void Ent_Init() g_vore = ReadCoord(); g_balance_vore_swallow_limit = ReadCoord(); - armor_enabled = ReadByte(); + armor_max = ReadCoord(); if(!postinit) PostInit(); diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index e6f9a562..ae594dc8 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -811,12 +811,12 @@ void CSQC_UpdateView(float w, float h) if(cvar("hud_postprocessing")) { // change saturation based on the amount of armor we have - // ranges between 0 and 50 armor. 0 armor is saturation 0.5, and 0.5 armor or above is saturation 1 + // ranges between 0.5 and 1 saturation, over 0 armor and half the armor limit - if(cvar("hud_saturation") && armor_enabled && spectatee_status != -1 && getstati(STAT_HEALTH) > 0) + if(cvar("hud_saturation") && armor_max && spectatee_status != -1 && getstati(STAT_HEALTH) > 0) { float saturation; - saturation = 0.5 + (getstati(STAT_ARMOR) * 1 * 0.01); + saturation = 0.5 + (getstati(STAT_ARMOR) / armor_max); saturation = bound(0, saturation, 1); if(cvar("r_glsl_saturation") != saturation) diff --git a/data/qcsrc/client/main.qh b/data/qcsrc/client/main.qh index 68bc2300..a158bf27 100644 --- a/data/qcsrc/client/main.qh +++ b/data/qcsrc/client/main.qh @@ -168,7 +168,7 @@ float g_weaponswitchdelay; float g_vore; float g_balance_vore_swallow_limit; -float armor_enabled; +float armor_max; //hooks float calledhooks; diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index ef0e2db0..66b11a02 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -1046,10 +1046,10 @@ float ClientInit_SendEntity(entity to, float sf) WriteCoord(MSG_ENTITY, g_balance_vore_swallow_limit); // tell the client if this server uses armor - float armor_enabled; + float armor_max; 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")) - armor_enabled = TRUE; - WriteByte(MSG_ENTITY, armor_enabled); + armor_max = cvar("g_balance_armor_limit"); + WriteCoord(MSG_ENTITY, armor_max); return TRUE; } -- 2.39.2