fix fire owner handling
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Wed, 27 Jan 2010 10:40:03 +0000 (10:40 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Wed, 27 Jan 2010 10:40:03 +0000 (10:40 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8577 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/qcsrc/server/g_damage.qc

index 541eaa6..4b5fa6c 100644 (file)
@@ -1309,10 +1309,17 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
 void Fire_ApplyDamage(entity e)
 {
        float t, d, hi, ty;
+       entity o;
 
        if not(Fire_IsBurning(e))
                return;
 
+       o = e.owner;
+       while(o.owner)
+               o = o.owner;
+       if(clienttype(o) == CLIENTTYPE_NOTACLIENT)
+               o = e.fire_owner;
+
        // water and slime stop fire
        if(e.waterlevel)
        if(e.watertype != CONTENT_LAVA)
@@ -1343,7 +1350,7 @@ void Fire_ApplyDamage(entity e)
                {
                        t = cvar("g_balance_firetransfer_time") * (e.fire_endtime - time);
                        d = cvar("g_balance_firetransfer_damage") * e.fire_damagepersec * t;
-                       Fire_AddDamage(other, e, d, t, DEATH_FIRE);
+                       Fire_AddDamage(other, o, d, t, DEATH_FIRE);
                }
        }
 }