]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
remove dp_sf networking to clients, only scale force by dp_sf when it's self-force
authordrjaska <drjaska83@gmail.com>
Wed, 28 Dec 2022 11:31:01 +0000 (13:31 +0200)
committerdrjaska <drjaska83@gmail.com>
Wed, 28 Dec 2022 11:31:01 +0000 (13:31 +0200)
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/weapons/weapon/devastator.qh
qcsrc/server/client.qc
qcsrc/server/damage.qc

index 4e05e681db3d48d8c37276dfe4339e4e895fcd9e..560c817017dc5319992b401d53257fbab7c4983f 100644 (file)
@@ -1114,7 +1114,6 @@ NET_HANDLE(ENT_CLIENT_INIT, bool isnew)
        strcpy(forcefog, ReadString());
 
        armorblockpercent = ReadByte() / 255.0;
-       damagepush_speedfactor = ReadByte() / 255.0;
 
        serverflags = ReadByte();
 
index 1f9e6a9a03e5aa1f78ef13dd78a8de13b79853ca..333d20cb59c34877e7b2a18216334b28b6b622cf 100644 (file)
@@ -139,7 +139,6 @@ vector camera_direction;
 const float ALPHA_MIN_VISIBLE = 0.003;
 
 float armorblockpercent;
-float damagepush_speedfactor;
 
 //hooks
 int calledhooks;
index 5f3cf9d43b3fd32979fc245e41d3ba66ca49d7c8..411c6d1534981148981e7bf33aef9172f98aa75c 100644 (file)
@@ -240,7 +240,8 @@ 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, damagepush_speedfactor);
+                               // gibs are unscaled by damagepush_speedfactor
+                               it.velocity += it.damageforcescale * thisforce;
                                UNSET_ONGROUND(it);
                        }
 
index 70c72f52cba160dbcad5ab19e82e476f102f090c..2b4f8b1ff765320e4850450f6505dd8e5aeab2c2 100644 (file)
@@ -23,8 +23,8 @@ CLASS(Devastator, Weapon)
        BEGIN(class) \
                P(class, prefix, ammo, float, NONE) \
         P(class, prefix, animtime, float, NONE) \
-        P(class, prefix, damageforcescale, float, NONE) \
         P(class, prefix, damage, float, NONE) \
+        P(class, prefix, damageforcescale, float, NONE) \
         P(class, prefix, detonatedelay, float, NONE) \
         P(class, prefix, edgedamage, float, NONE) \
         P(class, prefix, force, float, NONE) \
index 58fda9a016cdc2b42cd0c5ef8622f9c28d699cae..740c377a1d7d47b504176456878d980da26ef903 100644 (file)
@@ -878,7 +878,6 @@ 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);
 }
@@ -891,11 +890,6 @@ 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 d93d00bf5f58d368a1f338c970d1657368ec46b9..61fcb6f6dc5d17a78da2c44dfd9ee20a50778401 100644 (file)
@@ -829,7 +829,11 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
        if (force)
        if (!IS_PLAYER(targ) || !StatusEffects_active(STATUSEFFECT_SpawnShield, targ) || targ == attacker)
        {
-               vector farce = damage_explosion_calcpush(targ.damageforcescale * force, targ.velocity, autocvar_g_balance_damagepush_speedfactor);
+               float dp_sf = 0;
+               if (attacker == targ) // only apply dp_sf to self-force
+                       dp_sf = autocvar_g_balance_damagepush_speedfactor;
+
+               vector farce = damage_explosion_calcpush(targ.damageforcescale * force, targ.velocity, dp_sf);
                if(targ.move_movetype == MOVETYPE_PHYSICS)
                {
                        entity farcent = new(farce);