Added the global float "intermission" to CSQC defs (in clprogdefs.h). Intermission...
authordresk <dresk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 24 Jul 2007 06:11:10 +0000 (06:11 +0000)
committerdresk <dresk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 24 Jul 2007 06:11:10 +0000 (06:11 +0000)
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
clprogdefs.h
csprogs.c

index 54eee31..b304a75 100644 (file)
@@ -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;
 
index b9354fb..9145da9 100644 (file)
@@ -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
index 6ef012e..06bcea5 100644 (file)
--- 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;