]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/havocbot/havocbot.qc
Merge branch 'master' into Juhu/strafehud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / havocbot / havocbot.qc
index 3d744f7d972762b00fd63d6eba8efb2741593b21..40a07a44c43c1d23422b88edcfd438bf95ec00d5 100644 (file)
@@ -2,8 +2,15 @@
 
 #include "roles.qh"
 
-#include <server/defs.qh>
+#include <server/bot/api.qh>
+#include <server/client.qh>
+#include <common/weapons/_all.qh>
+#include <common/stats.qh>
+#include <server/damage.qh>
+#include <server/items/items.qh>
 #include <server/miscfunctions.qh>
+#include <server/weapons/selection.qh>
+#include <server/weapons/weaponsystem.qh>
 #include "../cvars.qh"
 
 #include "../aim.qh"
@@ -22,6 +29,7 @@
 
 #include <common/mapobjects/func/ladder.qh>
 #include <common/mapobjects/teleporters.qh>
+#include <common/mapobjects/trigger/hurt.qh>
 #include <common/mapobjects/trigger/jumppads.qh>
 
 #include <lib/warpzone/common.qh>
@@ -1174,7 +1182,7 @@ void havocbot_movetogoal(entity this)
        }
 
        float ladder_zdir = 0;
-       if(time < this.ladder_time)
+       if(this.ladder_entity)
        {
                if(this.goalcurrent.origin.z + this.goalcurrent.mins.z > this.origin.z + this.mins.z)
                {
@@ -1478,11 +1486,11 @@ void havocbot_chooseweapon(entity this, .entity weaponentity)
                if ( distance > bot_distance_far ) {
                        for(i=0; i < REGISTRY_COUNT(Weapons) && bot_weapons_far[i] != -1 ; ++i){
                                w = bot_weapons_far[i];
-                               if ( client_hasweapon(this, Weapons_from(w), weaponentity, true, false) )
+                               if ( client_hasweapon(this, REGISTRY_GET(Weapons, w), weaponentity, true, false) )
                                {
                                        if ((this.(weaponentity).m_weapon.m_id == w && combo) || havocbot_chooseweapon_checkreload(this, weaponentity, w))
                                                continue;
-                                       this.(weaponentity).m_switchweapon = Weapons_from(w);
+                                       this.(weaponentity).m_switchweapon = REGISTRY_GET(Weapons, w);
                                        return;
                                }
                        }
@@ -1492,11 +1500,11 @@ void havocbot_chooseweapon(entity this, .entity weaponentity)
                if ( distance > bot_distance_close) {
                        for(i=0; i < REGISTRY_COUNT(Weapons) && bot_weapons_mid[i] != -1 ; ++i){
                                w = bot_weapons_mid[i];
-                               if ( client_hasweapon(this, Weapons_from(w), weaponentity, true, false) )
+                               if ( client_hasweapon(this, REGISTRY_GET(Weapons, w), weaponentity, true, false) )
                                {
                                        if ((this.(weaponentity).m_weapon.m_id == w && combo) || havocbot_chooseweapon_checkreload(this, weaponentity, w))
                                                continue;
-                                       this.(weaponentity).m_switchweapon = Weapons_from(w);
+                                       this.(weaponentity).m_switchweapon = REGISTRY_GET(Weapons, w);
                                        return;
                                }
                        }
@@ -1505,11 +1513,11 @@ void havocbot_chooseweapon(entity this, .entity weaponentity)
                // Choose weapons for close distance
                for(i=0; i < REGISTRY_COUNT(Weapons) && bot_weapons_close[i] != -1 ; ++i){
                        w = bot_weapons_close[i];
-                       if ( client_hasweapon(this, Weapons_from(w), weaponentity, true, false) )
+                       if ( client_hasweapon(this, REGISTRY_GET(Weapons, w), weaponentity, true, false) )
                        {
                                if ((this.(weaponentity).m_weapon.m_id == w && combo) || havocbot_chooseweapon_checkreload(this, weaponentity, w))
                                        continue;
-                               this.(weaponentity).m_switchweapon = Weapons_from(w);
+                               this.(weaponentity).m_switchweapon = REGISTRY_GET(Weapons, w);
                                return;
                        }
                }