]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/aim.qc
Replace print calls with logger calls
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / aim.qc
index b529ed1c32f2899650b7dd498024f2b5b6bb0929..5549778be82c2f50ce7928b3e5fe5e6bd6f52557 100644 (file)
@@ -1,3 +1,9 @@
+#include "aim.qh"
+#include "../_all.qh"
+
+#include "bot.qh"
+
+#include "../mutators/mutators_include.qh"
 
 // traces multiple trajectories to find one that will impact the target
 // 'end' vector is the place it aims for,
@@ -137,8 +143,7 @@ float bot_shouldattack(entity e)
        if(e.flags & FL_NOTARGET)
                return false;
 
-       checkentity = e;
-       if(MUTATOR_CALLHOOK(BotShouldAttack))
+       if(MUTATOR_CALLHOOK(BotShouldAttack, e))
                return false;
 
        return true;
@@ -334,16 +339,16 @@ float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float a
        hf = self.dphitcontentsmask;
        self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
 
-       shotspeed *= g_weaponspeedfactor;
-       shotspeedupward *= g_weaponspeedfactor;
+       shotspeed *= W_WeaponSpeedFactor();
+       shotspeedupward *= W_WeaponSpeedFactor();
        if (!shotspeed)
        {
-               dprint("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " shotspeed is zero!\n");
+               LOG_TRACE("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " shotspeed is zero!\n");
                shotspeed = 1000000;
        }
        if (!maxshottime)
        {
-               dprint("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " maxshottime is zero!\n");
+               LOG_TRACE("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " maxshottime is zero!\n");
                maxshottime = 1;
        }
        makevectors(self.v_angle);