Skip to content

Commit

Permalink
console-only checkpoint option
Browse files Browse the repository at this point in the history
  • Loading branch information
videoP committed Oct 19, 2018
1 parent b4c3b66 commit d2a8f93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions codemp/game/g_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2305,6 +2305,11 @@ qboolean ClientUserinfoChanged( int clientNum ) { //I think anything treated as
else
client->pers.showChatCP = qfalse;

if (atoi(s) & JAPRO_PLUGIN_CONSOLECP)
client->pers.showConsoleCP = qfalse;
else
client->pers.showConsoleCP = qtrue;

if (atoi(s) & JAPRO_PLUGIN_NODMGNUMBERS)
client->pers.noDamageNumbers = qtrue;
else
Expand Down
2 changes: 2 additions & 0 deletions codemp/game/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ extern int dueltypes[MAX_CLIENTS];//JAPRO - Serverside - Fullforce Duels y is th
#define JAPRO_PLUGIN_CHATBOXCP (1<<25) //
#define JAPRO_PLUGIN_NODMGNUMBERS (1<<26) //
#define JAPRO_PLUGIN_CENTERMUZZLE (1<<27) //
#define JAPRO_PLUGIN_CONSOLECP (1<<28) //

//g_tweakVote TWEAKS
#define TV_ALLOW_SIEGESPECVOTE (1<<0)
Expand Down Expand Up @@ -904,6 +905,7 @@ typedef struct clientPersistant_s {
qboolean keepDemo;//japro autodemo for defrag... :S
qboolean showChatCP;
qboolean showCenterCP;
qboolean showConsoleCP;
int demoStoppedTime;
int stopRecordingTime;
char oldDemoName[16];
Expand Down
4 changes: 3 additions & 1 deletion codemp/game/g_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,9 @@ void TimerCheckpoint(gentity_t *trigger, gentity_t *player, trace_t *trace) {//J

if (player->client->pers.showCenterCP)
trap->SendServerCommand( player-g_entities, va("cp \"^3%.3fs^5, avg ^3%i^5u, max ^3%i^5u\n\n\n\n\n\n\n\n\n\n\"", (float)time * 0.001f, average, (int)(player->client->pers.stats.topSpeed + 0.5f)));
if (player->client->pers.showChatCP)
if (player->client->pers.showConsoleCP)
trap->SendServerCommand(player - g_entities, va("print \"^3%.3fs^5, avg ^3%i^5u, max ^3%i^5u\n\n\n\n\n\n\n\n\n\n\"", (float)time * 0.001f, average, (int)(player->client->pers.stats.topSpeed + 0.5f)));
else if (player->client->pers.showChatCP)
trap->SendServerCommand( player-g_entities, va("chat \"^5Checkpoint: ^3%.3f^5, avg ^3%i^5, max ^3%i^5 ups\"", (float)time * 0.001f, average, (int)(player->client->pers.stats.topSpeed + 0.5f)));

for (i=0; i<MAX_CLIENTS; i++) {//Also print to anyone spectating them..
Expand Down

0 comments on commit d2a8f93

Please sign in to comment.