]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Another load of self cases fixed
authorMario <mario@smbclan.net>
Tue, 22 Mar 2016 10:26:48 +0000 (20:26 +1000)
committerMario <mario@smbclan.net>
Tue, 22 Mar 2016 10:27:07 +0000 (20:27 +1000)
22 files changed:
qcsrc/common/mutators/mutator/overkill/hmg.qc
qcsrc/common/mutators/mutator/overkill/rpc.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/server/bot/aim.qc
qcsrc/server/bot/aim.qh

index cf7174a697bbc55f840aceddb835553a63efa620..1af6e82df83e3b2d4e2aceac616e388231372611 100644 (file)
@@ -104,9 +104,9 @@ METHOD(HeavyMachineGun, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
     if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
+        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 0.001, false);
     else
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false);
+        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, 1000000, 0, 0.001, false);
 }
 
 METHOD(HeavyMachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
index 79c491b566aafc546c6b8b732ffd0f84ace8e6e7..a5360a20cd4e1852cf2407353207660249d3b5ec 100644 (file)
@@ -153,7 +153,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep)
 METHOD(RocketPropelledChainsaw, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
-    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
+    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
 }
 
 METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
index 658ca935f1bcc3acebda486fed6e212c82021d98..d30afff01dc6eeb92223cb7ad979ce3637a0577a 100644 (file)
@@ -732,6 +732,7 @@ METHOD(Arc, wr_aim, void(entity thiswep))
     if(WEP_CVAR(arc, beam_botaimspeed))
     {
         PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(
+               self,
             WEP_CVAR(arc, beam_botaimspeed),
             0,
             WEP_CVAR(arc, beam_botaimlifetime),
@@ -741,6 +742,7 @@ METHOD(Arc, wr_aim, void(entity thiswep))
     else
     {
         PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(
+               self,
             1000000,
             0,
             0.001,
index cf1242aa4a3b1468fbf2fcc1ccace05084f5e781..23c4da6c468bcf92297daaebe1e6c45053b6e588 100644 (file)
@@ -156,12 +156,12 @@ METHOD(Blaster, wr_aim, void(entity thiswep))
     if(WEP_CVAR(blaster, secondary))
     {
         if((random() * (WEP_CVAR_PRI(blaster, damage) + WEP_CVAR_SEC(blaster, damage))) > WEP_CVAR_PRI(blaster, damage))
-            { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_SEC(blaster, speed), 0, WEP_CVAR_SEC(blaster, lifetime), false); }
+            { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR_SEC(blaster, speed), 0, WEP_CVAR_SEC(blaster, lifetime), false); }
         else
-            { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
+            { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
     }
     else
-        { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
+        { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
 }
 
 METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, .entity weaponentity, int fire))
index 4e912851f73514e609a154deb88e55c6e7c6ba95..9e2bb47416b890eded0d598ae31b485202557ef7 100644 (file)
@@ -571,9 +571,9 @@ METHOD(Crylink, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
     if(random() < 0.10)
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
     else
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
 }
 METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
index 5d963e52bc5eb80410e9ac1650e24c79721c6ec5..e8697afd1e96fdb47041bcc9b50d7c7869d94314 100644 (file)
@@ -408,7 +408,7 @@ void W_Devastator_Attack(Weapon thiswep)
 METHOD(Devastator, wr_aim, void(entity thiswep))
 {
     // aim and decide to fire if appropriate
-    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
+    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
     if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
     {
         // decide whether to detonate rockets
@@ -436,7 +436,7 @@ METHOD(Devastator, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
     // aim and decide to fire if appropriate
-    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
+    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
     if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
     {
         // decide whether to detonate rockets
index cc540b86b929e99460a64368bacf68d5a07ff448..b75106806269d839cd7af02118a72bbf9cc14a08 100644 (file)
@@ -435,9 +435,9 @@ METHOD(Electro, wr_aim, void(entity thiswep))
         float shoot;
 
         if(WEP_CVAR_PRI(electro, speed))
-            shoot = bot_aim(WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false);
+            shoot = bot_aim(self, WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false);
         else
-            shoot = bot_aim(1000000, 0, 0.001, false);
+            shoot = bot_aim(self, 1000000, 0, 0.001, false);
 
         if(shoot)
         {
@@ -447,7 +447,7 @@ METHOD(Electro, wr_aim, void(entity thiswep))
     }
     else
     {
-        if(bot_aim(WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true))
+        if(bot_aim(self, WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true))
         {
             PHYS_INPUT_BUTTON_ATCK2(self) = true;
             if(random() < 0.03) self.bot_secondary_electromooth = 0;
index a4632eb11dd6aeb42613025fc9852de6354c739a..4dc3bf86753d95cf1478269677eb14acdad44c08 100644 (file)
@@ -358,7 +358,7 @@ METHOD(Fireball, wr_aim, void(entity thiswep))
     PHYS_INPUT_BUTTON_ATCK2(self) = false;
     if(self.bot_primary_fireballmooth == 0)
     {
-        if(bot_aim(WEP_CVAR_PRI(fireball, speed), 0, WEP_CVAR_PRI(fireball, lifetime), false))
+        if(bot_aim(self, WEP_CVAR_PRI(fireball, speed), 0, WEP_CVAR_PRI(fireball, lifetime), false))
         {
             PHYS_INPUT_BUTTON_ATCK(self) = true;
             if(random() < 0.02) self.bot_primary_fireballmooth = 0;
@@ -366,7 +366,7 @@ METHOD(Fireball, wr_aim, void(entity thiswep))
     }
     else
     {
-        if(bot_aim(WEP_CVAR_SEC(fireball, speed), WEP_CVAR_SEC(fireball, speed_up), WEP_CVAR_SEC(fireball, lifetime), true))
+        if(bot_aim(self, WEP_CVAR_SEC(fireball, speed), WEP_CVAR_SEC(fireball, speed_up), WEP_CVAR_SEC(fireball, lifetime), true))
         {
             PHYS_INPUT_BUTTON_ATCK2(self) = true;
             if(random() < 0.01) self.bot_primary_fireballmooth = 1;
index 3204fa9387d8274e1b57303e6b841b5a73ab4f6c..2d5085fb115c82df9083585c3fefd6a4372bf0e1 100644 (file)
@@ -401,9 +401,9 @@ METHOD(Hagar, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
     if(random()>0.15)
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
     else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
 }
 METHOD(Hagar, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
index b0d57951b70b1fc3260f43ea38bf76717c3a9027..4be78821cde2ff5dcd0e3a8e4fffa1b655ab8cd7 100644 (file)
@@ -210,7 +210,7 @@ void W_HLAC_Attack2_Frame(Weapon thiswep)
 METHOD(HLAC, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
-    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
+    PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
 }
 METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
index ddf7a281c770a76f52013bfbe97d72f0b8c7aeb2..cb5edb1ad2159b0ed35560a8e89123b99de95934 100644 (file)
@@ -246,9 +246,9 @@ METHOD(MachineGun, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
     if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
+        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 0.001, false);
     else
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false);
+        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, 1000000, 0, 0.001, false);
 }
 METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
index 5ba8c92c7b520d43786a78a7140af8a7ee162c70..a40afe5a96d9aec1e83bf331411a1d64719f6f5f 100644 (file)
@@ -411,7 +411,7 @@ METHOD(MineLayer, wr_aim, void(entity thiswep))
     if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
         PHYS_INPUT_BUTTON_ATCK(self) = false;
     else
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
     if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
     {
         // decide whether to detonate mines
index eb261aecee3687a57d1fc2c1429e66c35ce6e834..61ca5132625bbd3f6685f413a7e1d3ed39f4e3fc 100644 (file)
@@ -305,7 +305,7 @@ METHOD(Mortar, wr_aim, void(entity thiswep))
     PHYS_INPUT_BUTTON_ATCK2(self) = false;
     if(self.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH
     {
-        if(bot_aim(WEP_CVAR_PRI(mortar, speed), WEP_CVAR_PRI(mortar, speed_up), WEP_CVAR_PRI(mortar, lifetime), true))
+        if(bot_aim(self, WEP_CVAR_PRI(mortar, speed), WEP_CVAR_PRI(mortar, speed_up), WEP_CVAR_PRI(mortar, lifetime), true))
         {
             PHYS_INPUT_BUTTON_ATCK(self) = true;
             if(random() < 0.01) self.bot_secondary_grenademooth = 1;
@@ -313,7 +313,7 @@ METHOD(Mortar, wr_aim, void(entity thiswep))
     }
     else
     {
-        if(bot_aim(WEP_CVAR_SEC(mortar, speed), WEP_CVAR_SEC(mortar, speed_up), WEP_CVAR_SEC(mortar, lifetime), true))
+        if(bot_aim(self, WEP_CVAR_SEC(mortar, speed), WEP_CVAR_SEC(mortar, speed_up), WEP_CVAR_SEC(mortar, lifetime), true))
         {
             PHYS_INPUT_BUTTON_ATCK2(self) = true;
             if(random() < 0.02) self.bot_secondary_grenademooth = 0;
index d9f919cc4a4253058a65d1b5d410d4d4fb5cd20b..1ff725d1f44034859ee417ff819e6600e9b84052 100644 (file)
@@ -298,7 +298,7 @@ METHOD(PortoLaunch, wr_aim, void(entity thiswep))
     PHYS_INPUT_BUTTON_ATCK(self) = false;
     PHYS_INPUT_BUTTON_ATCK2(self) = false;
     if(!WEP_CVAR(porto, secondary))
-        if(bot_aim(WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
+        if(bot_aim(self, WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
             PHYS_INPUT_BUTTON_ATCK(self) = true;
 }
 METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
index 92b05458630570542d9e80f83703a96a7f3d5942..7c0e3173386e137c04003a1f158cfc51ea1a41f9 100644 (file)
@@ -147,7 +147,7 @@ METHOD(Rifle, wr_aim, void(entity thiswep))
         self.bot_secondary_riflemooth = 0;
     if(self.bot_secondary_riflemooth == 0)
     {
-        if(bot_aim(1000000, 0, 0.001, false))
+        if(bot_aim(self, 1000000, 0, 0.001, false))
         {
             PHYS_INPUT_BUTTON_ATCK(self) = true;
             if(random() < 0.01) self.bot_secondary_riflemooth = 1;
@@ -155,7 +155,7 @@ METHOD(Rifle, wr_aim, void(entity thiswep))
     }
     else
     {
-        if(bot_aim(1000000, 0, 0.001, false))
+        if(bot_aim(self, 1000000, 0, 0.001, false))
         {
             PHYS_INPUT_BUTTON_ATCK2(self) = true;
             if(random() < 0.03) self.bot_secondary_riflemooth = 0;
index d13b381188f4127bf4ef139afb77739c5fc43e76..e151756720f11d444120827dbc86f633f625a58d 100644 (file)
@@ -603,11 +603,11 @@ METHOD(Seeker, wr_aim, void(entity thiswep))
     SELFPARAM();
     if(WEP_CVAR(seeker, type) == 1)
         if(W_Seeker_Tagged_Info(self, self.enemy) != world)
-            PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
+            PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
         else
-            PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+            PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
     else
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
 }
 METHOD(Seeker, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
index 9d47930ee3fe7a616e82f7f32e721b43e83f07b4..444f96894fa1f44e1e3c3e939c4de8005b249382 100644 (file)
@@ -675,9 +675,9 @@ METHOD(Shockwave, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
     if(vlen(self.origin - self.enemy.origin) <= WEP_CVAR(shockwave, melee_range))
-        { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false); }
+        { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, 1000000, 0, 0.001, false); }
     else
-        { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false); }
+        { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 0.001, false); }
 }
 METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
index 6cb0d0a74548d7c1d4ada244ab2f8549fcba431d..72f3d7a772c4012eb2ac8f6b05868a164e5d84d1 100644 (file)
@@ -230,9 +230,9 @@ METHOD(Shotgun, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
     if(vdist(self.origin - self.enemy.origin, <=, WEP_CVAR_SEC(shotgun, melee_range)))
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false);
+        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, 1000000, 0, 0.001, false);
     else
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
+        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 0.001, false);
 }
 METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
index 3d3e8961867e95059b27a7f7dc6fe26d17f857ed..933124564c1c37d5c6a1e118b85aafa7d5855421 100644 (file)
@@ -343,9 +343,9 @@ METHOD(Vaporizer, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
     if(self.(thiswep.ammo_field) > 0)
-        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 1, false);
+        PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 1, false);
     else
-        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
+        PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
 }
 METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
index fdb89d77a16262bc885e5e0d96c97fbc0dd9502b..0faccbbb73eec00d61f717dd45cb5da2b56851ea 100644 (file)
@@ -213,7 +213,7 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary)
 METHOD(Vortex, wr_aim, void(entity thiswep))
 {
     SELFPARAM();
-    if(bot_aim(1000000, 0, 1, false))
+    if(bot_aim(self, 1000000, 0, 1, false))
         PHYS_INPUT_BUTTON_ATCK(self) = true;
     else
     {
index 75f1bb19097ee2cb19b0a3e8e202025d2f135b83..2d6a642bab38d064d563b46880d17f2044648a1c 100644 (file)
@@ -321,12 +321,12 @@ vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, flo
        return targorigin + targvelocity * (shotdelay + vlen(targorigin - shotorg) / shotspeed);
 }
 
-float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float applygravity)
-{SELFPARAM();
+bool bot_aim(entity this, float shotspeed, float shotspeedupward, float maxshottime, bool applygravity)
+{
        float f, r, hf, distanceratio;
        vector v;
        /*
-       eprint(self);
+       eprint(this);
        dprint("bot_aim(", ftos(shotspeed));
        dprint(", ", ftos(shotspeedupward));
        dprint(", ", ftos(maxshottime));
@@ -334,60 +334,60 @@ float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float a
        dprint(");\n");
        */
 
-       hf = self.dphitcontentsmask;
-       self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+       hf = this.dphitcontentsmask;
+       this.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
 
        shotspeed *= W_WeaponSpeedFactor();
        shotspeedupward *= W_WeaponSpeedFactor();
        if (!shotspeed)
        {
-               LOG_TRACE("bot_aim: WARNING: weapon ", PS(self).m_weapon.m_name, " shotspeed is zero!\n");
+               LOG_TRACE("bot_aim: WARNING: weapon ", PS(this).m_weapon.m_name, " shotspeed is zero!\n");
                shotspeed = 1000000;
        }
        if (!maxshottime)
        {
-               LOG_TRACE("bot_aim: WARNING: weapon ", PS(self).m_weapon.m_name, " maxshottime is zero!\n");
+               LOG_TRACE("bot_aim: WARNING: weapon ", PS(this).m_weapon.m_name, " maxshottime is zero!\n");
                maxshottime = 1;
        }
-       makevectors(self.v_angle);
-       shotorg = self.origin + self.view_ofs;
+       makevectors(this.v_angle);
+       shotorg = this.origin + this.view_ofs;
        shotdir = v_forward;
-       v = bot_shotlead(self.bot_aimtargorigin, self.bot_aimtargvelocity, shotspeed, self.bot_aimlatency);
+       v = bot_shotlead(this.bot_aimtargorigin, this.bot_aimtargvelocity, shotspeed, this.bot_aimlatency);
        distanceratio = sqrt(bound(0,skill,10000))*0.3*(vlen(v-shotorg)-100)/autocvar_bot_ai_aimskill_firetolerance_distdegrees;
        distanceratio = bound(0,distanceratio,1);
        r =  (autocvar_bot_ai_aimskill_firetolerance_maxdegrees-autocvar_bot_ai_aimskill_firetolerance_mindegrees)
                * (1-distanceratio) + autocvar_bot_ai_aimskill_firetolerance_mindegrees;
-       if (applygravity && self.bot_aimtarg)
+       if (applygravity && this.bot_aimtarg)
        {
-               if (!findtrajectorywithleading(shotorg, '0 0 0', '0 0 0', self.bot_aimtarg, shotspeed, shotspeedupward, maxshottime, 0, self))
+               if (!findtrajectorywithleading(shotorg, '0 0 0', '0 0 0', this.bot_aimtarg, shotspeed, shotspeedupward, maxshottime, 0, this))
                {
-                       self.dphitcontentsmask = hf;
+                       this.dphitcontentsmask = hf;
                        return false;
                }
 
-               f = bot_aimdir(self, findtrajectory_velocity - shotspeedupward * '0 0 1', r);
+               f = bot_aimdir(this, findtrajectory_velocity - shotspeedupward * '0 0 1', r);
        }
        else
        {
-               f = bot_aimdir(self, v - shotorg, r);
-               //dprint("AIM: ");dprint(vtos(self.bot_aimtargorigin));dprint(" + ");dprint(vtos(self.bot_aimtargvelocity));dprint(" * ");dprint(ftos(self.bot_aimlatency + vlen(self.bot_aimtargorigin - shotorg) / shotspeed));dprint(" = ");dprint(vtos(v));dprint(" : aimdir = ");dprint(vtos(normalize(v - shotorg)));dprint(" : ");dprint(vtos(shotdir));dprint("\n");
-               //traceline(shotorg, shotorg + shotdir * 10000, false, self);
+               f = bot_aimdir(this, v - shotorg, r);
+               //dprint("AIM: ");dprint(vtos(this.bot_aimtargorigin));dprint(" + ");dprint(vtos(this.bot_aimtargvelocity));dprint(" * ");dprint(ftos(this.bot_aimlatency + vlen(this.bot_aimtargorigin - shotorg) / shotspeed));dprint(" = ");dprint(vtos(v));dprint(" : aimdir = ");dprint(vtos(normalize(v - shotorg)));dprint(" : ");dprint(vtos(shotdir));dprint("\n");
+               //traceline(shotorg, shotorg + shotdir * 10000, false, this);
                //if (trace_ent.takedamage)
                //if (trace_fraction < 1)
-               //if (!bot_shouldattack(self, trace_ent))
+               //if (!bot_shouldattack(this, trace_ent))
                //      return false;
-               traceline(shotorg, self.bot_aimtargorigin, false, self);
+               traceline(shotorg, this.bot_aimtargorigin, false, this);
                if (trace_fraction < 1)
-               if (trace_ent != self.enemy)
-               if (!bot_shouldattack(self, trace_ent))
+               if (trace_ent != this.enemy)
+               if (!bot_shouldattack(this, trace_ent))
                {
-                       self.dphitcontentsmask = hf;
+                       this.dphitcontentsmask = hf;
                        return false;
                }
        }
 
        //if (r > maxshottime * shotspeed)
        //      return false;
-       self.dphitcontentsmask = hf;
+       this.dphitcontentsmask = hf;
        return true;
 }
index a21272d876eea48043439eb5364e88fa56cb50fa..5a1cb16c4d05a8a56d9f8cc1b2747cf8770db70e 100644 (file)
@@ -91,7 +91,7 @@ void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1,
 
 float bot_shouldattack(entity this, entity targ);
 float bot_aimdir(entity this, vector v, float maxfiredeviation);
-float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float applygravity);
+bool bot_aim(entity this, float shotspeed, float shotspeedupward, float maxshottime, bool applygravity);
 float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, float shotspeed, float shotspeedupward, float maxtime, float shotdelay, entity ignore);
 
 vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, float shotdelay);