]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add minelayer_maxmines global constant so crosshair ring can know how many mines...
authorSamual <samual@xonotic.org>
Wed, 16 Feb 2011 10:26:23 +0000 (05:26 -0500)
committerSamual <samual@xonotic.org>
Wed, 16 Feb 2011 10:26:23 +0000 (05:26 -0500)
qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/common/constants.qh
qcsrc/server/cl_client.qc

index 3d15295942e21b6cefc40c52386f5f7ea3e8d6f0..99c8d5c2b95a244fa81933968951dfcf688153a1 100644 (file)
@@ -263,6 +263,8 @@ float nex_scope;
 
 float cr_maxbullets;
 
+float minelayer_maxmines;
+
 float bgmtime;
 
 string weaponorder_byimpulse;
index 8614863318dcac9396237f4d6462dc30cdcf2826..f24b483d6d7b5ce9181212abf199f44a7f757ba1 100644 (file)
@@ -1095,6 +1095,8 @@ void Ent_Init()
        serverflags = ReadByte();
 
        cr_maxbullets = ReadByte();
+       
+       minelayer_maxmines = ReadByte();
 
        g_trueaim_minrange = ReadCoord();
 
index 9da93923d3ed5cf49af4a1f9808edd8837b70df2..6746cfe6ba6bf77d8f2bae5f5a2479db3556c65e 100644 (file)
@@ -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;
index ad4c73a230153d647587d26f2bbf26fc04ea1d2e..d5df6586c4923c72951da6052c23b095390d8052 100644 (file)
@@ -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;
index 71584d350379869717ce8e3cd1ca6a2a3ce47f24..543df17c0eeb08e8eb2198d3239e6285288bb1ae 100644 (file)
@@ -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;
 }