From: terencehill Date: Thu, 27 May 2021 16:15:29 +0000 (+0200) Subject: Prevent negative damage by correctly bounding g_spawnshield_blockdamage. Also whiteli... X-Git-Tag: xonotic-v0.8.5~405^2~26 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1b857498e7161c37460027237c1f90be890c9abc;p=xonotic%2Fxonotic-data.pk3dir.git Prevent negative damage by correctly bounding g_spawnshield_blockdamage. Also whitelist g_spawnshield_blockdamage as an allowed server setting --- diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index 4ad0d7936..0a7dd86cb 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -249,7 +249,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, damage = 0; } else if (time < this.spawnshieldtime && autocvar_g_spawnshield_blockdamage < 1) - damage *= 1 - max(0, autocvar_g_spawnshield_blockdamage); + damage *= 1 - bound(0, autocvar_g_spawnshield_blockdamage, 1); if(deathtype & HITTYPE_SOUND) // sound based attacks cause bleeding from the ears { diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 1165bd303..cfbc0caf7 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -462,7 +462,7 @@ void cvar_changes_init() BADCVAR("g_player_brightness"); BADCVAR("g_rocket_flying"); BADCVAR("g_rocket_flying_disabledelays"); - BADCVAR("g_spawnshieldtime"); + BADPREFIX("g_spawnshield"); BADCVAR("g_start_delay"); BADCVAR("g_superspectate"); BADCVAR("g_tdm_teams_override");