diff --git a/Quake/client.h b/Quake/client.h index 12f0147e..c71fb04c 100644 --- a/Quake/client.h +++ b/Quake/client.h @@ -389,7 +389,7 @@ typedef struct char observer[2]; // woods for ghost code to memory #observer int server; // woods for server type detection #servertype int fps; // woods #f_config - int modtype; // woods #modtype detect mp server mod type 5 - FTE, 4 - hybrid crx, 3 - crmod, 2 - crctf, 1 - crx + int modtype; // woods #modtype detect mp server mod type 6 - runequake, 5 - FTE, 4 - hybrid crx, 3 - crmod, 2 - crctf, 1 - crx int modetype; // woods crx mode detection -- 1 - ctf, 2 - dm, 3 - ra, 4 - ca, 5 - airshot, 6 - wipeout, 7 - freetag int playmode; // woods crx play mode detection -- 1 - match, 2 - ffa/normal/pug, 3 - practice int teamscore[3]; // woods #hud_diff diff --git a/Quake/console.c b/Quake/console.c index 4a6b8249..9373a4ee 100644 --- a/Quake/console.c +++ b/Quake/console.c @@ -46,6 +46,7 @@ int con_buffersize; //johnfitz -- user can now override default qboolean con_forcedup; // because no entities to refresh qboolean matchstats = false; // woods qboolean netquakeio = false; // woods +qboolean firstCheckPassed = false; // woods int con_totallines; // total lines in console scrollback int con_backscroll; // lines up from bottom to display @@ -508,6 +509,25 @@ static void Con_Print (const char *txt) if (!strcmp(txt, "Match unpaused\n") && !cls.demoplayback && !cls.demorecording) Cmd_ExecuteString("record\n", src_command); + if (cl.modtype == 6) // runequake observer detection + { + if (!strcmp(txt, "Now riding ")) + strncpy(cl.observer, "y", sizeof(cl.observer)); + + if (!strcmp(txt, cl_name.string)) + firstCheckPassed = true; + else if (firstCheckPassed && !strcmp(txt, " joined the game\n")) + { + strncpy(cl.observer, "n", sizeof(cl.observer)); + firstCheckPassed = false; // Reset flag after the condition is met + } + else if (firstCheckPassed) // The next text was not " joined the game\n", reset the flag + firstCheckPassed = false; + + if (q_strcasestr(txt, "]observer")) + strncpy(cl.observer, "y", sizeof(cl.observer)); + } + if (strstr(txt, ": ") && cls.signon == SIGNONS && cl.maxclients > 1) // woods #like { strncpy(cl.lastchat, txt, sizeof(cl.lastchat) - 1); diff --git a/Quake/gl_screen.c b/Quake/gl_screen.c index cf5a217a..642fad1f 100644 --- a/Quake/gl_screen.c +++ b/Quake/gl_screen.c @@ -273,6 +273,15 @@ void SCR_CenterPrint (const char *str) //update centerprint data return; } + char qfrunequake[18] = { 247, 247, 247, 174, 242, 245, 238, 229, 241, 245, 225, 235, 229, 174, 227, 239, 237, '\0' }; // woods -- quake font red 'www.runequake.com' #autoid + + if ((strstr(str, qfrunequake))) + { + cl.modtype = 6; + strncpy(cl.observer, "y", sizeof(cl.observer)); + return; + } + // =============================== // woods for center print filter -> this is #flagstatus // ===============================