diff --git a/src/pr2_cmds.c b/src/pr2_cmds.c index 7a705a6a..999d2838 100644 --- a/src/pr2_cmds.c +++ b/src/pr2_cmds.c @@ -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; @@ -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)); @@ -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; diff --git a/src/server.h b/src/server.h index 70c8cd8f..423617da 100644 --- a/src/server.h +++ b/src/server.h @@ -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 diff --git a/src/sv_main.c b/src/sv_main.c index 97935baf..f00481cb 100644 --- a/src/sv_main.c +++ b/src/sv_main.c @@ -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