From: Mario Date: Mon, 17 Jul 2017 14:44:26 +0000 (+1000) Subject: Make g_balance_damagepush_speedfactor a networked variable rather than relying on... X-Git-Tag: xonotic-v0.8.5~2581 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=af376cc21c7130e4d62257778b6f08fb03056120;p=xonotic%2Fxonotic-data.pk3dir.git Make g_balance_damagepush_speedfactor a networked variable rather than relying on the client's setting --- diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 4cfc5bbe0..2711cd182 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -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; diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 1467a99cc..13b63652b 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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(); diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index bbf69d28d..a2f4d18bb 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -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; diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 71e1e2a7b..c62bbd6b6 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -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); } diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 635bed7cf..abb5693a3 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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() diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 1cc9db2b9..d991794b7 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -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) {