]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Prevent negative damage by correctly bounding g_spawnshield_blockdamage. Also whiteli...
authorterencehill <piuntn@gmail.com>
Thu, 27 May 2021 16:15:29 +0000 (18:15 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 27 May 2021 16:15:29 +0000 (18:15 +0200)
qcsrc/server/player.qc
qcsrc/server/world.qc

index 4ad0d7936d0f82d27bd34a0c693bfcb40a5cac65..0a7dd86cb32aec451ec87a824473248507aff0f3 100644 (file)
@@ -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
                {
index 1165bd303f0e6fef0f903d4ca3ebb0c7188dea99..cfbc0caf7a86facb47588c2838d14e84c8f0716d 100644 (file)
@@ -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");