]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a bug that would crash the server if too many bots were near fire
authorMario <mario.mario@y7mail.com>
Wed, 7 May 2014 19:36:01 +0000 (05:36 +1000)
committerMario <mario.mario@y7mail.com>
Wed, 7 May 2014 19:36:01 +0000 (05:36 +1000)
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/g_damage.qc

index a0e6bfffd42926004503c8e9f63b8e9eaaa07836..f9f6835797966d2f2b7f9d137381a01ffb55618c 100644 (file)
@@ -721,11 +721,11 @@ void havocbot_movetogoal()
                        // avoiding dangers and obstacles
                        vector dst_ahead, dst_down;
                        makevectors(self.v_angle_y * '0 1 0');
-                       dst_ahead = self.origin + self.view_ofs + (self.velocity * 0.4) + (v_forward * 32 * 3);
-                       dst_down = dst_ahead + '0 0 -1500';
+                       dst_ahead = normalize(self.origin + self.view_ofs + (self.velocity * 0.4) + (v_forward * 32 * 3));
+                       dst_down = dst_ahead - '0 0 1500';
 
                        // Look ahead
-                       traceline(self.origin + self.view_ofs , dst_ahead, TRUE, world);
+                       traceline(self.origin + self.view_ofs, dst_ahead, TRUE, world);
 
                        // Check head-banging against walls
                        if(vlen(self.origin + self.view_ofs - trace_endpos) < 25 && !(self.aistatus & AI_STATUS_OUT_WATER))
index 45319ca0748e6f19a6ae95722967249421ea724f..29b19e6a16a91a86532774f3599dd1105d95c051 100644 (file)
@@ -1092,7 +1092,7 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
                mintime = e.fire_endtime - time;
                maxtime = max(mintime, t);
 
-               mindps = e.fire_damagepersec;
+               mindps = max(0.1, e.fire_damagepersec);
                maxdps = max(mindps, dps);
 
                if(maxtime > mintime || maxdps > mindps)
@@ -1217,6 +1217,7 @@ void Fire_ApplyDamage(entity e)
        e.fire_hitsound = TRUE;
 
        if (!IS_INDEPENDENT_PLAYER(e))
+       if(!e.freezetag_frozen)
        FOR_EACH_PLAYER(other) if(e != other)
        {
                if(IS_PLAYER(other))