From: Samual Date: Wed, 16 Feb 2011 10:26:23 +0000 (-0500) Subject: Add minelayer_maxmines global constant so crosshair ring can know how many mines... X-Git-Tag: xonotic-v0.5.0~309^2~17^2^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5e07a91da9cb9b821aa7938b6b1de15f8b18459d;p=xonotic%2Fxonotic-data.pk3dir.git Add minelayer_maxmines global constant so crosshair ring can know how many mines are possible --- diff --git a/qcsrc/client/Defs.qc b/qcsrc/client/Defs.qc index 3d1529594..99c8d5c2b 100644 --- a/qcsrc/client/Defs.qc +++ b/qcsrc/client/Defs.qc @@ -263,6 +263,8 @@ float nex_scope; float cr_maxbullets; +float minelayer_maxmines; + float bgmtime; string weaponorder_byimpulse; diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 861486331..f24b483d6 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1095,6 +1095,8 @@ void Ent_Init() serverflags = ReadByte(); cr_maxbullets = ReadByte(); + + minelayer_maxmines = ReadByte(); g_trueaim_minrange = ReadCoord(); diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 9da93923d..6746cfe6b 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -1107,9 +1107,9 @@ void CSQC_UpdateView(float w, float h) ring_image = "gfx/crosshair_ring_nexgun.tga"; ring_rgb = wcross_color; } - else if (activeweapon == WEP_MINE_LAYER && autocvar_crosshair_ring_minelayer) + else if (activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer) { - ring_value = bound(0, getstati(STAT_LAYED_MINES) / 3, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to. + ring_value = bound(0, getstati(STAT_LAYED_MINES) / minelayer_maxmines, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to. ring_alpha = wcross_alpha * autocvar_crosshair_ring_minelayer_alpha; ring_image = "gfx/crosshair_ring.tga"; ring_rgb = wcross_color; diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index ad4c73a23..d5df6586c 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -63,6 +63,7 @@ const float TE_CSQC_NOTIFY = 112; const float TE_CSQC_WEAPONCOMPLAIN = 113; const float TE_CSQC_NEX_SCOPE = 116; const float TE_CSQC_CR_MAXBULLETS = 117; +const float TE_CSQC_MINELAYER_MAXMINES = 118; const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder const float RACE_NET_CHECKPOINT_CLEAR = 1; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 71584d350..543df17c0 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1110,6 +1110,7 @@ float ClientInit_SendEntity(entity to, float sf) WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_secondary); // client has to know if it should zoom or not WriteByte(MSG_ENTITY, serverflags); // client has to know if it should zoom or not WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_magazinecapacity); // rifle max bullets + WriteByte(MSG_ENTITY, autocvar_g_balance_minelayer_limit); // rifle max bullets WriteCoord(MSG_ENTITY, autocvar_g_trueaim_minrange); return TRUE; }