]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make g_balance_damagepush_speedfactor a networked variable rather than relying on...
authorMario <mario@smbclan.net>
Mon, 17 Jul 2017 14:44:26 +0000 (00:44 +1000)
committerMario <mario@smbclan.net>
Mon, 17 Jul 2017 14:44:26 +0000 (00:44 +1000)
qcsrc/client/autocvars.qh
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/server/client.qc
qcsrc/server/teamplay.qc

index 4cfc5bbe0b96851cba15ef732a9ee88dfe846dbf..2711cd182f73c3c92f77440bbdaf22242b6651aa 100644 (file)
@@ -152,7 +152,6 @@ float autocvar_crosshair_ring_reload_size;
 float autocvar_crosshair_size;
 int autocvar_ekg;
 float autocvar_fov;
-float autocvar_g_balance_damagepush_speedfactor;
 bool autocvar_hud_cursormode = true;
 float autocvar_hud_colorflash_alpha;
 bool autocvar_hud_configure_checkcollisions;
index 1467a99ccf880fecdec7275fe565702c37372938..13b63652bb5e8e4c6d470b4d8a040f4f202d35b1 100644 (file)
@@ -976,6 +976,7 @@ NET_HANDLE(ENT_CLIENT_INIT, bool isnew)
        forcefog = strzone(ReadString());
 
        armorblockpercent = ReadByte() / 255.0;
+       damagepush_speedfactor = ReadByte() / 255.0;
 
        serverflags = ReadByte();
 
index bbf69d28d1bcd39586a78041babc247bc2166cea..a2f4d18bba97e2ef4070fe83ac362d83dd462404 100644 (file)
@@ -86,6 +86,7 @@ void centerprint_generic(float new_id, string strMessage, float duration, float
 const float ALPHA_MIN_VISIBLE = 0.003;
 
 float armorblockpercent;
+float damagepush_speedfactor;
 
 //hooks
 int calledhooks;
index 71e1e2a7bcdd96dcf3f72629d7e147d4db03aab3..c62bbd6b68cd5b08c5108a9b0c0dd9ac77598693 100644 (file)
@@ -244,7 +244,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                if(it.damageforcescale)
                        if(vdist(thisforce, !=, 0))
                        {
-                               it.velocity = it.velocity + damage_explosion_calcpush(it.damageforcescale * thisforce, it.velocity, autocvar_g_balance_damagepush_speedfactor);
+                               it.velocity = it.velocity + damage_explosion_calcpush(it.damageforcescale * thisforce, it.velocity, damagepush_speedfactor);
                                UNSET_ONGROUND(it);
                        }
 
index 635bed7cf74a63141cc810eafa61fe8bc0740ebd..abb5693a340481980f363730e2af91eb7f4b59ed 100644 (file)
@@ -772,6 +772,7 @@ void ClientInit_misc(entity this)
        else
                WriteString(channel, "");
        WriteByte(channel, this.count * 255.0); // g_balance_armor_blockpercent
+       WriteByte(channel, this.cnt * 255.0); // g_balance_damagepush_speedfactor
        WriteByte(channel, serverflags);
        WriteCoord(channel, autocvar_g_trueaim_minrange);
 }
@@ -784,6 +785,11 @@ void ClientInit_CheckUpdate(entity this)
                this.count = autocvar_g_balance_armor_blockpercent;
                this.SendFlags |= 1;
        }
+       if(this.cnt != autocvar_g_balance_damagepush_speedfactor)
+       {
+               this.cnt = autocvar_g_balance_damagepush_speedfactor;
+               this.SendFlags |= 1;
+       }
 }
 
 void ClientInit_Spawn()
index 1cc9db2b970eb0357db1ab57c7f61480c539451c..d991794b75b69e9107c48577fe89602821a291bd 100644 (file)
@@ -351,7 +351,7 @@ void GetTeamCounts(entity ignore)
                                        cb1 = cb1 + bvalue;
                                }
                        }
-                       if(t == NUM_TEAM_2)
+                       else if(t == NUM_TEAM_2)
                        {
                                if(c2 >= 0)
                                {
@@ -359,7 +359,7 @@ void GetTeamCounts(entity ignore)
                                        cb2 = cb2 + bvalue;
                                }
                        }
-                       if(t == NUM_TEAM_3)
+                       else if(t == NUM_TEAM_3)
                        {
                                if(c3 >= 0)
                                {
@@ -367,7 +367,7 @@ void GetTeamCounts(entity ignore)
                                        cb3 = cb3 + bvalue;
                                }
                        }
-                       if(t == NUM_TEAM_4)
+                       else if(t == NUM_TEAM_4)
                        {
                                if(c4 >= 0)
                                {