From d2a8f93cbd24d6e4558e46d100bc420c1761779d Mon Sep 17 00:00:00 2001 From: david Date: Fri, 19 Oct 2018 14:22:03 -0400 Subject: [PATCH] console-only checkpoint option --- codemp/game/g_client.c | 5 +++++ codemp/game/g_local.h | 2 ++ codemp/game/g_trigger.c | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/codemp/game/g_client.c b/codemp/game/g_client.c index dd868a6146..44fb4174e8 100644 --- a/codemp/game/g_client.c +++ b/codemp/game/g_client.c @@ -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 diff --git a/codemp/game/g_local.h b/codemp/game/g_local.h index a99b508de9..e84ae2f5fb 100644 --- a/codemp/game/g_local.h +++ b/codemp/game/g_local.h @@ -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) @@ -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]; diff --git a/codemp/game/g_trigger.c b/codemp/game/g_trigger.c index 0786ad04ed..a0e4426c98 100644 --- a/codemp/game/g_trigger.c +++ b/codemp/game/g_trigger.c @@ -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