]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't apply the Burning effect if fire inflicts no damage; it prevents a bug where... master
authorterencehill <piuntn@gmail.com>
Sun, 18 May 2025 18:21:42 +0000 (20:21 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 18 May 2025 18:25:40 +0000 (20:25 +0200)
if hit by a teammate with a high firerate weapon such as the machine gun secondary attack

qcsrc/server/damage.qc

index fac8bb731ad74e84ea672bbfb9bbe9b1a8f3feed..024f7b141a980306fbae501cd09d1f5d96f10749 100644 (file)
@@ -999,9 +999,11 @@ bool Heal(entity targ, entity inflictor, float amount, float limit)
 
 float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
 {
-       float dps;
        float maxtime, mintime, maxdamage, mindamage, maxdps, mindps, totaldamage, totaltime;
 
+       if (d <= 0)
+               return -1;
+
        if(IS_PLAYER(e))
        {
                if(IS_DEAD(e))
@@ -1009,7 +1011,7 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
        }
 
        t = max(t, 0.1);
-       dps = d / t;
+       float dps = d / t;
        if(StatusEffects_active(STATUSEFFECT_Burning, e))
        {
                float fireendtime = StatusEffects_gettime(STATUSEFFECT_Burning, e);