Skip to content

Commit

Permalink
Fixes against upstream Nuclide. Added zpak001.pk3dir/def/bot.def and …
Browse files Browse the repository at this point in the history
…make use of it.
  • Loading branch information
eukara committed Jan 27, 2024
1 parent bc4bd88 commit a8250fd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
7 changes: 5 additions & 2 deletions src/server/bot.qc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ vector getEntityCenterPos(entity e) {
return newVec;
}

class csbot:bot
class csbot:NSBot
{
void(void) csbot;

Expand Down Expand Up @@ -372,6 +372,10 @@ void csbot::AimLerp(vector aimpos, float flLerp) {
void
csbot::PostFrame(void)
{
if (team == 0) {
CSEv_JoinAuto();
}

team = infokeyf(this, "*team");
m_gflagsBackup = gflags;
};
Expand Down Expand Up @@ -439,7 +443,6 @@ csbot::GetVIPSafetyZoneByIndex(int index)
void
csbot::csbot(void)
{
bot::bot();
targetname = "_csbot_";
team = infokeyf(this, "*team");
m_actionIsPlanting = FALSE;
Expand Down
2 changes: 2 additions & 0 deletions src/server/gamerules_deathmatch.qc
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ CSDeathmatchRules::ConsoleCommand(NSClientPlayer pp, string cmd)
tokenize(cmd);

switch (argv(0)) {
#if 0
case "bot_add":
bot pete = (bot)Bot_AddQuick();
Bot_RandomColormap(pete);
Expand All @@ -262,6 +263,7 @@ CSDeathmatchRules::ConsoleCommand(NSClientPlayer pp, string cmd)
pete.SetInfoKey("model", argv(2));
search_end(pm);
break;
#endif
case "jumptest":
makevectors(pp.v_angle);
traceline(pp.origin + pp.view_ofs, pp.origin + pp.view_ofs + v_forward * 1024, FALSE, pp);
Expand Down
14 changes: 0 additions & 14 deletions src/server/gamerules_multiplayer.qc
Original file line number Diff line number Diff line change
Expand Up @@ -1082,26 +1082,12 @@ CSMultiplayerRules::PlayerSpawn(NSClientPlayer pl)
forceinfokey(pl, "*team", "0");
}

void
CSMultiplayerRules_BotJoin(void)
{
spawnfunc_csbot();
CSEv_JoinAuto();
}

bool
CSMultiplayerRules::ConsoleCommand(NSClientPlayer pp, string cmd)
{
tokenize(cmd);

switch (argv(0)) {
case "bot_add":
entity bot_ent = Bot_AddQuick();
if (bot_ent) {
bot_ent.think = CSMultiplayerRules_BotJoin;
bot_ent.nextthink = time;
}
break;
default:
return (false);
}
Expand Down
4 changes: 4 additions & 0 deletions zpak001.pk3dir/def/bot.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
entityDef bot
{
spawnclass csbot
}

0 comments on commit a8250fd

Please sign in to comment.