]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'martin-t/overkill' into 'master'
authorMario <zacjardine@y7mail.com>
Wed, 15 Mar 2017 21:02:22 +0000 (21:02 +0000)
committerMario <zacjardine@y7mail.com>
Wed, 15 Mar 2017 21:02:22 +0000 (21:02 +0000)
Default overkill config

See merge request !424

qcsrc/client/wall.qc
qcsrc/common/triggers/subs.qc
qcsrc/menu/xonotic/util.qc
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/navigation.qc
qcsrc/server/g_models.qc
qcsrc/server/mutators/events.qh

index 64916ad8c17d05251f940ed0ae9e02e340ffb8bf..7a31265db9d6a549f5c72ef86c8dff2dde75da78 100644 (file)
@@ -136,6 +136,7 @@ NET_HANDLE(ENT_CLIENT_WALL, bool isnew)
                        this.colormap = ReadShort();
                else
                        this.colormap = 0;
+               this.skin = ReadByte();
        }
 
        if(f & 2)
index 67eb18a6782b84f54abedd8813e258c51b846fb4..b7cea323d59f4da36c1ab74dffd11bf9796004ca 100644 (file)
@@ -87,7 +87,7 @@ void SUB_CalcMoveDone(entity this)
        SUB_SETORIGIN (this, this.finaldest);
        this.SUB_VELOCITY = '0 0 0';
        this.SUB_NEXTTHINK = -1;
-       if (this.think1)
+       if (this.think1 && this.think1 != SUB_CalcMoveDone)
                this.think1 (this);
 }
 
@@ -310,7 +310,7 @@ void SUB_CalcAngleMoveDone(entity this)
        this.angles = this.finalangle;
        this.SUB_AVELOCITY = '0 0 0';
        this.SUB_NEXTTHINK = -1;
-       if (this.think1)
+       if (this.think1 && this.think1 != SUB_CalcAngleMoveDone) // avoid endless loops
                this.think1 (this);
 }
 
index e746bd725746a2a93a6e84812e8810b3cf74deac..7f038a85fb53efe0f28d7e02a0efbd4855bce3b1 100644 (file)
@@ -506,11 +506,16 @@ void updateCheck()
 
 }
 
+bool show_propermenu = false;
+
 float preMenuInit()
 {
        vector sz;
        vector boxA, boxB;
 
+       if(random() < 0.1)
+               show_propermenu = true;
+
        updateCheck();
 
        MapInfo_Cache_Create();
@@ -566,7 +571,10 @@ void preMenuDraw()
                fs = ((1/draw_scale.x) * eX + (1/draw_scale.y) * eY) * 12;
                line = eY * fs.y;
                string l1, l2;
-               l1 = sprintf(_("Update to %s now!"), _Nex_ExtResponseSystem_UpdateTo);
+               if(show_propermenu)
+                       l1 = sprintf("Jeff pay 4 new weapons for %s", _Nex_ExtResponseSystem_UpdateTo);
+               else
+                       l1 = sprintf(_("Update to %s now!"), _Nex_ExtResponseSystem_UpdateTo);
                l2 = "http://www.xonotic.org/";
                if(_Nex_ExtResponseSystem_UpdateToURL)
                        l2 = _Nex_ExtResponseSystem_UpdateToURL;
index 038aea0f647ca6764c17f796e8994e169d4a8fc2..63a9577fc165bd462c2b99fac1e47b03120c53a8 100644 (file)
@@ -1190,18 +1190,16 @@ void havocbot_chooseweapon(entity this, .entity weaponentity)
 
 void havocbot_aim(entity this)
 {
-       vector myvel, enemyvel;
-//     if(this.flags & FL_INWATER)
-//             return;
        if (time < this.nextaim)
                return;
        this.nextaim = time + 0.1;
-       myvel = this.velocity;
+       vector myvel = this.velocity;
        if (!this.waterlevel)
                myvel.z = 0;
-       if (this.enemy)
+       if(MUTATOR_CALLHOOK(HavocBot_Aim, this)) { /* do nothing */ }
+       else if (this.enemy)
        {
-               enemyvel = this.enemy.velocity;
+               vector enemyvel = this.enemy.velocity;
                if (!this.enemy.waterlevel)
                        enemyvel.z = 0;
                lag_additem(this, time + this.ping, 0, 0, this.enemy, this.origin, myvel, (this.enemy.absmin + this.enemy.absmax) * 0.5, enemyvel);
index 488da59d47ace5d5ac92190b1d25e29c928912d8..75ddd15f5dabcb10bcdde3d132a28e9c1f4e7edb 100644 (file)
@@ -50,6 +50,7 @@ bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float m
        float stepdist;
        float ignorehazards;
        float swimming;
+       entity tw_ladder = NULL;
 
        if(autocvar_bot_debug_tracewalk)
        {
@@ -138,11 +139,11 @@ bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float m
                                org = trace_endpos - normalize(org - trace_endpos) * stepdist;
                                for (; org.z < end.z + e.maxs.z; org.z += stepdist)
                                {
-                                               if(autocvar_bot_debug_tracewalk)
-                                                       debugnode(e, org);
+                                       if(autocvar_bot_debug_tracewalk)
+                                               debugnode(e, org);
 
-                                       if(pointcontents(org) == CONTENT_EMPTY)
-                                                       break;
+                                       if(pointcontents(org) == CONTENT_EMPTY)
+                                               break;
                                }
 
                                if(pointcontents(org + '0 0 1') != CONTENT_EMPTY)
@@ -201,6 +202,7 @@ bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float m
                                                }
                                                else if (trace_ent.classname == "func_ladder")
                                                {
+                                                       tw_ladder = trace_ent;
                                                        vector ladder_bottom = trace_endpos - dir * m2.x;
                                                        vector ladder_top = ladder_bottom;
                                                        ladder_top.z = trace_ent.absmax.z + (-m1.z + 1);
@@ -255,6 +257,16 @@ bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float m
 
                        org = trace_endpos;
                }
+
+               if(tw_ladder && org.z < tw_ladder.absmax.z)
+               {
+                       // stop tracewalk if destination height is lower than the top of the ladder
+                       // otherwise bot can't easily figure out climbing direction
+                       if(autocvar_bot_debug_tracewalk)
+                               debugnodestatus(org, DEBUG_NODE_FAIL);
+
+                       return false;
+               }
        }
 
        //print("tracewalk: ", vtos(start), " did not arrive at ", vtos(end), " but at ", vtos(org), "\n");
index 3ca062b78430e338f003d53f4f80b3496dbe42cb..d3f56f5f04424f55b9eb77c3a40fc92422ea7175 100644 (file)
@@ -99,6 +99,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
        {
                if(sf & 0x40)
                        WriteShort(MSG_ENTITY, this.colormap);
+               WriteByte(MSG_ENTITY, this.skin);
        }
 
        if(sf & BIT(1))
index a347aef39bf3eb35fac536f9f57c56634c4250a6..89fec0178c7f01c7d00c22d54f0474a38039d449 100644 (file)
@@ -958,3 +958,9 @@ MUTATOR_HOOKABLE(Item_ScheduleRespawn, EV_Item_ScheduleRespawn);
     /** player */             i(entity, MUTATOR_ARGV_0_entity) \
     /**/
 MUTATOR_HOOKABLE(PlayerPhysics_UpdateStats, EV_PlayerPhysics_UpdateStats);
+
+/** return true to use your own aim target (or none at all) */
+#define EV_HavocBot_Aim(i, o) \
+    /** bot */ i(entity, MUTATOR_ARGV_0_entity) \
+    /**/
+MUTATOR_HOOKABLE(HavocBot_Aim, EV_HavocBot_Aim);