]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
Merge branch 'master' into terencehill/bot_ai
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / onslaught / sv_onslaught.qc
index 0a2aeb11c7145cc274833ba548d55b5ede68511f..ec5e79cf73b72eeb65d45568c8942dd5d609d17a 100644 (file)
@@ -38,9 +38,7 @@ bool clientcamera_send(entity this, entity to, int sf)
 {
        WriteHeader(MSG_ENTITY, ENT_ONSCAMERA);
 
-       WriteCoord(MSG_ENTITY, this.origin_x);
-       WriteCoord(MSG_ENTITY, this.origin_y);
-       WriteCoord(MSG_ENTITY, this.origin_z);
+       WriteVector(MSG_ENTITY, this.origin);
 
        WriteAngle(MSG_ENTITY, this.angles_x);
        WriteAngle(MSG_ENTITY, this.angles_y);
@@ -272,15 +270,11 @@ bool ons_Link_Send(entity this, entity to, int sendflags)
        WriteByte(MSG_ENTITY, sendflags);
        if(sendflags & 1)
        {
-               WriteCoord(MSG_ENTITY, this.goalentity.origin_x);
-               WriteCoord(MSG_ENTITY, this.goalentity.origin_y);
-               WriteCoord(MSG_ENTITY, this.goalentity.origin_z);
+               WriteVector(MSG_ENTITY, this.goalentity.origin);
        }
        if(sendflags & 2)
        {
-               WriteCoord(MSG_ENTITY, this.enemy.origin_x);
-               WriteCoord(MSG_ENTITY, this.enemy.origin_y);
-               WriteCoord(MSG_ENTITY, this.enemy.origin_z);
+               WriteVector(MSG_ENTITY, this.enemy.origin);
        }
        if(sendflags & 4)
        {
@@ -1235,7 +1229,7 @@ void havocbot_goalrating_ons_offenseitems(entity this, float ratingscale, vector
        // Needs weapons?
        int c = 0;
        FOREACH(Weapons, it != WEP_Null, {
-               if(this.weapons & (it.m_wepset))
+               if(STAT(WEAPONS, this) & (it.m_wepset))
                if(++c >= 4)
                        break;
        });
@@ -1254,7 +1248,7 @@ void havocbot_goalrating_ons_offenseitems(entity this, float ratingscale, vector
        {
                // gather health and armor only
                if (it.solid)
-               if ( ((it.health || it.armorvalue) && needarmor) || (it.weapons && needweapons ) )
+               if ( ((it.health || it.armorvalue) && needarmor) || (STAT(WEAPONS, it) && needweapons ) )
                if (vdist(it.origin - org, <, sradius))
                {
                        int t = it.bot_pickupevalfunc(this, it);
@@ -1491,7 +1485,7 @@ void havocbot_role_ons_offense(entity this)
        if (navigation_goalrating_timeout(this))
        {
                navigation_goalrating_start(this);
-               havocbot_goalrating_enemyplayers(this, 20000, this.origin, 650);
+               havocbot_goalrating_enemyplayers(this, 10000, this.origin, 650);
                if(!havocbot_goalrating_ons_generator_attack(this, 20000))
                        havocbot_goalrating_ons_controlpoints_attack(this, 20000);
                havocbot_goalrating_ons_offenseitems(this, 10000, this.origin, 10000);