]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'TimePath/bot_api' into 'master'
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 8 Oct 2015 06:07:02 +0000 (06:07 +0000)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 8 Oct 2015 06:07:02 +0000 (06:07 +0000)
Decouple bots

If we're ever going to develop a new AI, this separation will make switching implementaions trivial

See merge request !237

1  2 
qcsrc/server/cl_client.qc
qcsrc/server/g_world.qc
qcsrc/server/t_items.qc
qcsrc/server/teamplay.qc

index 71efa5f9d931233f32899305692f023ceaea5d96,127080323dbbab27dffc3cbaa47592f6f1f94999..adf2542cbd5853f0b8f7e78ca045ac00b7b00ec4
@@@ -20,8 -20,7 +20,7 @@@
  #include "campaign.qh"
  #include "command/common.qh"
  
- #include "bot/bot.qh"
- #include "bot/navigation.qh"
+ #include "bot/api.qh"
  
  #include "../common/vehicles/all.qh"
  
@@@ -1216,7 -1215,7 +1215,7 @@@ void ClientConnect (void
        else
                stuffcmd(self, "set _teams_available 0\n");
  
 -      attach_entcs();
 +      attach_entcs(self);
  
        bot_relinkplayerlist();
  
@@@ -1302,7 -1301,8 +1301,7 @@@ void ClientDisconnect (void
  
        bot_clientdisconnect();
  
 -      if(self.entcs)
 -              detach_entcs();
 +      detach_entcs(self);
  
        if(autocvar_sv_eventlog)
                GameLogEcho(strcat(":part:", ftos(self.playerid)));
diff --combined qcsrc/server/g_world.qc
index a0f9a3f131ab2e2552340692736ad82fd398d324,efc3b950458d1a77e780bff4ad01635c73b6d689..b202f284f6b664903899c35c0514824928592481
@@@ -3,7 -3,6 +3,6 @@@
  
  #include "anticheat.qh"
  #include "antilag.qh"
- #include "bot/bot.qh"
  #include "campaign.qh"
  #include "cheats.qh"
  #include "cl_client.qh"
@@@ -1000,6 -999,22 +999,6 @@@ string Map_Filename(float position
        return strcat("maps/", argv(position), ".bsp");
  }
  
 -string strwords(string s, float w)
 -{
 -      float endpos;
 -      for(endpos = 0; w && endpos >= 0; --w)
 -              endpos = strstrofs(s, " ", endpos + 1);
 -      if(endpos < 0)
 -              return s;
 -      else
 -              return substring(s, 0, endpos);
 -}
 -
 -float strhasword(string s, string w)
 -{
 -      return strstrofs(strcat(" ", s, " "), strcat(" ", w, " "), 0) >= 0;
 -}
 -
  void Map_MarkAsRecent(string m)
  {
        cvar_set("g_maplist_mostrecent", strwords(strcat(m, " ", autocvar_g_maplist_mostrecent), max(0, autocvar_g_maplist_mostrecent_count)));
diff --combined qcsrc/server/t_items.qc
index 0a5785037f0223df12170535d348786cdb431d4b,e19b5d48f7b30fcf569b3b408d63f9a351264557..964b05e1bd2f69099745e91c212191d8f356b209
@@@ -5,9 -5,6 +5,6 @@@
  #if defined(SVQC)
      #include "_all.qh"
  
-     #include "bot/bot.qh"
-     #include "bot/waypoints.qh"
      #include "mutators/mutators_include.qh"
  
      #include "weapons/common.qh"
@@@ -476,7 -473,7 +473,7 @@@ void Item_RespawnCountdown (void
                                {
                                        entity wi = get_weaponinfo(self.weapon);
                                        if (wi.m_id) {
 -                                              entity wp = WaypointSprite_Spawn(WP_Weapon, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP);
 +                                              entity wp = WaypointSprite_Spawn(WP_Weapon, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_Weapon);
                                                wp.wp_extra = wi.m_id;
                                                break;
                                        }
                                {
                                        entity ii = self.itemdef;
                                        if (ii.m_id) {
 -                                              entity wp = WaypointSprite_Spawn(WP_Item, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP);
 +                                              entity wp = WaypointSprite_Spawn(WP_Item, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_Item);
                                                wp.wp_extra = ii.m_id;
                                                break;
                                        }
diff --combined qcsrc/server/teamplay.qc
index 2fbbd50b32e3c9dc78b214ae0dcda2c6a9f817e3,8f0120cd8b843d9cbb280bcb99b16303d93da6be..35a764c56d507d596a96a2fe2d05ff46db7956ec
@@@ -6,8 -6,6 +6,6 @@@
  #include "scores.qh"
  #include "scores_rules.qh"
  
- #include "bot/bot.qh"
  #include "command/vote.qh"
  
  #include "mutators/mutators_include.qh"
@@@ -247,6 -245,9 +245,6 @@@ void InitGameplayMode(
                MUTATOR_ADD(gamemode_invasion);
        }
  
 -      if(teamplay)
 -              entcs_init();
 -
        cache_mutatormsg = strzone("");
        cache_lastmutatormsg = strzone("");