Skip to content

Commit

Permalink
Merge remote-tracking branch 'tot/tot' into totmode
Browse files Browse the repository at this point in the history
  • Loading branch information
dusty-qw committed May 28, 2024
2 parents 4bdd739 + f66b170 commit ceae637
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/pr2_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,7 @@ intptr_t PF2_Map_Extension(char *name, int mapto)
}
/////////Bot Functions
extern cvar_t maxclients, maxspectators;
int PF2_Add_Bot(char *name, int bottomcolor, int topcolor, char *skin)
int PF2_Add_Bot(char *name, int bottomcolor, int topcolor, char *skin, int skill)
{
client_t *cl, *newcl = NULL;
int edictnum;
Expand Down Expand Up @@ -2043,6 +2043,7 @@ int PF2_Add_Bot(char *name, int bottomcolor, int topcolor, char *skin)
newcl->datagram.maxsize = sizeof( newcl->datagram_buf );
newcl->spectator = 0;
newcl->isBot = 1;
newcl->botSkill = skill;
SV_SetClientConnectionTime(newcl);
strlcpy(newcl->name, name, sizeof(newcl->name));

Expand Down Expand Up @@ -2628,7 +2629,7 @@ intptr_t PR2_GameSystemCalls(intptr_t *args) {
PF2_redirectcmd(NUM_FOR_GAME_EDICT(VMA(1)), VMA(2));
return 0;
case G_Add_Bot:
return PF2_Add_Bot(VMA(1), args[2], args[3], VMA(4));
return PF2_Add_Bot(VMA(1), args[2], args[3], VMA(4), args[5]);
case G_Remove_Bot:
PF2_Remove_Bot(args[1]);
return 0;
Expand Down
1 change: 1 addition & 0 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ typedef struct client_s
#ifdef USE_PR2
int isBot;
usercmd_t botcmd; // bot movment
int botSkill;
#endif
char name[CLIENT_NAME_LEN]; // for printing to other people

Expand Down
2 changes: 1 addition & 1 deletion src/sv_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ int SV_CalcPing (client_t *cl)
count = 0;
#ifdef USE_PR2
if (cl->isBot) {
return 10;
return cl->botSkill > 0 ? cl->botSkill : 10;
}
#endif
for (frame = cl->frames, i=0 ; i<UPDATE_BACKUP ; i++, frame++)
Expand Down

0 comments on commit ceae637

Please sign in to comment.