From: drjaska Date: Wed, 28 Dec 2022 11:31:01 +0000 (+0200) Subject: remove dp_sf networking to clients, only scale force by dp_sf when it's self-force X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=79237559fc56cec02b30e4a663b0deade408cbfa;p=xonotic%2Fxonotic-data.pk3dir.git remove dp_sf networking to clients, only scale force by dp_sf when it's self-force --- diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 4e05e681d..560c81701 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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(); diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 1f9e6a9a0..333d20cb5 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -139,7 +139,6 @@ vector camera_direction; const float ALPHA_MIN_VISIBLE = 0.003; float armorblockpercent; -float damagepush_speedfactor; //hooks int calledhooks; diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 5f3cf9d43..411c6d153 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -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); } diff --git a/qcsrc/common/weapons/weapon/devastator.qh b/qcsrc/common/weapons/weapon/devastator.qh index 70c72f52c..2b4f8b1ff 100644 --- a/qcsrc/common/weapons/weapon/devastator.qh +++ b/qcsrc/common/weapons/weapon/devastator.qh @@ -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) \ diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 58fda9a01..740c377a1 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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() diff --git a/qcsrc/server/damage.qc b/qcsrc/server/damage.qc index d93d00bf5..61fcb6f6d 100644 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@ -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);