From aad158b86f1152258b6d0dc8052f2424c63ab5b7 Mon Sep 17 00:00:00 2001 From: dresk Date: Tue, 24 Jul 2007 06:11:10 +0000 Subject: [PATCH] Added the global float "intermission" to CSQC defs (in clprogdefs.h). Intermission was added after the global float servercommandframe, and MUST be added in all CSQC definitions files at this location. This float is updated whenever the client intermission is updated. This new global float is part of Spike's CSQC definition, as it exists in his globals as well (albeit in a different order from DP's). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7495 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_parse.c | 3 +++ clprogdefs.h | 3 ++- csprogs.c | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cl_parse.c b/cl_parse.c index 54eee319..b304a756 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -3699,12 +3699,14 @@ void CL_ParseServerMessage(void) if(!cl.intermission) cl.completed_time = cl.time; cl.intermission = 1; + CL_VM_UpdateIntermissionState(cl.intermission); break; case svc_finale: if(!cl.intermission) cl.completed_time = cl.time; cl.intermission = 2; + CL_VM_UpdateIntermissionState(cl.intermission); SCR_CenterPrint(MSG_ReadString ()); break; @@ -3712,6 +3714,7 @@ void CL_ParseServerMessage(void) if(!cl.intermission) cl.completed_time = cl.time; cl.intermission = 3; + CL_VM_UpdateIntermissionState(cl.intermission); SCR_CenterPrint(MSG_ReadString ()); break; diff --git a/clprogdefs.h b/clprogdefs.h index b9354fbb..9145da99 100644 --- a/clprogdefs.h +++ b/clprogdefs.h @@ -17,6 +17,7 @@ typedef struct cl_globalvars_s float maxclients; float clientcommandframe; float servercommandframe; + float intermission; string_t mapname; vec3_t v_forward; vec3_t v_up; @@ -91,6 +92,6 @@ typedef struct cl_entvars_s int owner; } cl_entvars_t; -#define CL_PROGHEADER_CRC 52195 +#define CL_PROGHEADER_CRC 49165 #endif diff --git a/csprogs.c b/csprogs.c index 6ef012e7..06bcea59 100644 --- a/csprogs.c +++ b/csprogs.c @@ -400,6 +400,16 @@ void CL_VM_Parse_CenterPrint (const char *msg) CSQC_END } +void CL_VM_UpdateIntermissionState (int intermission) +{ + if(cl.csqc_loaded) + { + CSQC_BEGIN + prog->globals.client->intermission = intermission; // Dresk : This global is required and part of the CRC verification, so no check is required for it. + CSQC_END + } +} + float CL_VM_Event (float event) //[515]: needed ? I'd say "YES", but don't know for what :D { float r = 0; -- 2.39.2