]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/havocbot/havocbot.qc
Remove various SELFPARAM
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / havocbot / havocbot.qc
index 5403b35ca6110e3dde18e1840d019300de04ac1e..0d59fa6e4251f1fad85259692af0062e519113d1 100644 (file)
@@ -107,7 +107,7 @@ void havocbot_ai(entity this)
                if(this.weapons)
                {
                        Weapon w = PS(this).m_weapon;
-                       w.wr_aim(w);
+                       w.wr_aim(w, this);
                        if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(this))
                        {
                                PHYS_INPUT_BUTTON_ATCK(this) = false;
@@ -807,7 +807,7 @@ void havocbot_movetogoal(entity this)
                                this.aistatus |= AI_STATUS_DANGER_AHEAD;
                }
 
-               dodge = havocbot_dodge();
+               dodge = havocbot_dodge(this);
                dodge = dodge * bound(0,0.5+(skill+this.bot_dodgeskill)*0.1,1);
                evadelava = evadelava * bound(1,3-(skill+this.bot_dodgeskill),3); //Noobs fear lava a lot and take more distance from it
                traceline(this.origin, ( ( this.enemy.absmin + this.enemy.absmax ) * 0.5 ), true, world);
@@ -993,7 +993,7 @@ float havocbot_chooseweapon_checkreload(entity this, int new_weapon)
        {
                bool other_weapon_available = false;
                FOREACH(Weapons, it != WEP_Null, LAMBDA(
-                       if(it.wr_checkammo1(it) + it.wr_checkammo2(it))
+                       if(it.wr_checkammo1(it, this) + it.wr_checkammo2(it, this))
                                other_weapon_available = true;
                ));
                if(other_weapon_available)
@@ -1106,24 +1106,24 @@ void havocbot_chooseweapon(entity this)
 
 void havocbot_aim(entity this)
 {
-       vector selfvel, enemyvel;
+       vector myvel, enemyvel;
 //     if(this.flags & FL_INWATER)
 //             return;
        if (time < this.nextaim)
                return;
        this.nextaim = time + 0.1;
-       selfvel = this.velocity;
+       myvel = this.velocity;
        if (!this.waterlevel)
-               selfvel.z = 0;
+               myvel.z = 0;
        if (this.enemy)
        {
                enemyvel = this.enemy.velocity;
                if (!this.enemy.waterlevel)
                        enemyvel.z = 0;
-               lag_additem(this, time + this.ping, 0, 0, this.enemy, this.origin, selfvel, (this.enemy.absmin + this.enemy.absmax) * 0.5, enemyvel);
+               lag_additem(this, time + this.ping, 0, 0, this.enemy, this.origin, myvel, (this.enemy.absmin + this.enemy.absmax) * 0.5, enemyvel);
        }
        else
-               lag_additem(this, time + this.ping, 0, 0, world, this.origin, selfvel, ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5, '0 0 0');
+               lag_additem(this, time + this.ping, 0, 0, world, this.origin, myvel, ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5, '0 0 0');
 }
 
 bool havocbot_moveto_refresh_route(entity this)
@@ -1268,7 +1268,7 @@ void havocbot_setupbot(entity this)
        havocbot_chooserole(this);
 }
 
-vector havocbot_dodge()
+vector havocbot_dodge(entity this)
 {
        // LordHavoc: disabled because this is too expensive
        return '0 0 0';
@@ -1282,13 +1282,13 @@ vector havocbot_dodge()
        head = findchainfloat(bot_dodge, true);
        while(head)
        {
-               if (head.owner != self)
+               if (head.owner != this)
                {
                        vl = vlen(head.velocity);
                        if (vl > autocvar_sv_maxspeed * 0.3)
                        {
                                n = normalize(head.velocity);
-                               v = self.origin - head.origin;
+                               v = this.origin - head.origin;
                                d = v * n;
                                if (d > (0 - head.bot_dodgerating))
                                if (d < (vl * 0.2 + head.bot_dodgerating))
@@ -1306,11 +1306,11 @@ vector havocbot_dodge()
                        }
                        else
                        {
-                               danger = head.bot_dodgerating - vlen(head.origin - self.origin);
+                               danger = head.bot_dodgerating - vlen(head.origin - this.origin);
                                if (bestdanger < danger)
                                {
                                        bestdanger = danger;
-                                       dodge = normalize(self.origin - head.origin);
+                                       dodge = normalize(this.origin - head.origin);
                                }
                        }
                }