X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fhavocbot%2Fhavocbot.qc;h=7b7c6474307a9c81db7cceaaa5eac771420db6c1;hb=95c7f3405f82d9975617acc0ca4d4bcf5c4acba2;hp=139926b7e4a844e7080b14c11445716a94ffbb05;hpb=464305bd2132971e2d24a19989baa94789ad9e68;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 139926b7e..7b7c64743 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -1,9 +1,18 @@ #include "havocbot.qh" -#include "role_onslaught.qc" -#include "role_keyhunt.qc" -#include "roles.qc" +#include "../../_all.qh" + +#include "../aim.qh" +#include "../bot.qh" +#include "../navigation.qh" +#include "../scripting.qh" +#include "../waypoints.qh" + +#include "../../../common/constants.qh" + #include "../../../common/triggers/trigger/jumppads.qh" +#include "../../../warpzonelib/common.qh" + void havocbot_ai() { if(self.draggedby) @@ -149,9 +158,6 @@ void havocbot_ai() // if the bot is not attacking, consider reloading weapons if (!(self.aistatus & AI_STATUS_ATTACKING)) { - float i; - entity e; - // we are currently holding a weapon that's not fully loaded, reload it if(skill >= 2) // bots can only reload the held weapon on purpose past this skill if(self.clip_load < self.clip_size) @@ -162,9 +168,9 @@ void havocbot_ai() if(skill >= 5) // bots can only look for unloaded weapons past this skill if(self.clip_load >= 0) // only if we're not reloading a weapon already { - for(i = WEP_FIRST; i <= WEP_LAST; ++i) + for (int i = WEP_FIRST; i <= WEP_LAST; ++i) { - e = get_weaponinfo(i); + entity e = get_weaponinfo(i); if ((self.weapons & WepSet_FromWeapon(i)) && (e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < e.reloading_ammo)) self.switchweapon = i; } @@ -594,7 +600,7 @@ void havocbot_movetogoal() else if(self.health>WEP_CVAR(devastator, damage)*0.5) { if(self.velocity.z < 0) - if(client_hasweapon(self, WEP_DEVASTATOR, true, false)) + if(client_hasweapon(self, WEP_DEVASTATOR.m_id, true, false)) { self.movement_x = maxspeed; @@ -608,7 +614,7 @@ void havocbot_movetogoal() return; } - self.switchweapon = WEP_DEVASTATOR; + self.switchweapon = WEP_DEVASTATOR.m_id; self.v_angle_x = 90; self.BUTTON_ATCK = true; self.rocketjumptime = time + WEP_CVAR(devastator, detonatedelay); @@ -850,7 +856,7 @@ void havocbot_movetogoal() void havocbot_chooseenemy() { entity head, best, head2; - float rating, bestrating, i, hf; + float rating, bestrating, hf; vector eye, v; if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self)) { @@ -902,10 +908,24 @@ void havocbot_chooseenemy() self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE; - for(i = 0; ; ++i) + bool scan_transparent = false; + bool scan_secondary_targets = false; + while(true) { - while (head) + scan_secondary_targets = false; + for ( ; head; head = head.chain) { + if(!scan_secondary_targets) + { + if(head.classname == "misc_breakablemodel") + continue; + } + else + { + if(head.classname != "misc_breakablemodel") + continue; + } + v = (head.absmin + head.absmax) * 0.5; rating = vlen(v - eye); if (rating