]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Added the map name (ie. "The Grisly Grotto") to the world.message field string in...
authordresk <dresk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 24 Jul 2007 03:50:38 +0000 (03:50 +0000)
committerdresk <dresk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 24 Jul 2007 03:50:38 +0000 (03:50 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7494 d7cf8633-e32d-0410-b094-e92efae38249

csprogs.c
progsvm.h
prvm_edict.c

index 26aa822add799951628e00d3dcc2f53017eaa2e6..6ef012e7737d192e1b969f874bab651e209323d5 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -539,6 +539,7 @@ void CL_VM_Init (void)
        fs_offset_t csprogsdatasize;
        int csprogsdatacrc, requiredcrc;
        int requiredsize;
+       prvm_eval_t *val;
 
        // reset csqc_progcrc after reading it, so that changing servers doesn't
        // expect csqc on the next server
@@ -636,6 +637,11 @@ void CL_VM_Init (void)
        prog->globals.client->mapname = PRVM_SetEngineString(cl.worldmodel->name);
        prog->globals.client->player_localentnum = cl.playerentity;
 
+       // set map description (use world entity 0)
+       val = PRVM_EDICTFIELDVALUE(prog->edicts, prog->fieldoffsets.message);
+       if(val)
+               val->string = PRVM_SetEngineString(cl.levelname);
+
        // call the prog init
        PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Init, "QC function CSQC_Init is missing");
 
index f2fe16bc37d8247f6d0e748e0c3e1a797acedb27..226a6120826910c70e066150a8a8da68e2d00c08 100644 (file)
--- a/progsvm.h
+++ b/progsvm.h
@@ -185,6 +185,7 @@ typedef struct prvm_prog_fieldoffsets_s
        int items2; // ssqc
        int lerpfrac; // csqc
        int light_lev; // ssqc
+       int message; // csqc
        int modelflags; // ssqc
        int movement; // ssqc
        int nextthink; // common - used by OP_STATE
index bec4765f1fc59dd54baac674f0a210ab3ea665eb..22bf88460188e36a545f722e50befa283f36d001 100644 (file)
@@ -1378,6 +1378,7 @@ void PRVM_FindOffsets(void)
        prog->fieldoffsets.items2                         = PRVM_ED_FindFieldOffset("items2");
        prog->fieldoffsets.lerpfrac                       = PRVM_ED_FindFieldOffset("lerpfrac");
        prog->fieldoffsets.light_lev                      = PRVM_ED_FindFieldOffset("light_lev");
+       prog->fieldoffsets.message                        = PRVM_ED_FindFieldOffset("message");
        prog->fieldoffsets.modelflags                     = PRVM_ED_FindFieldOffset("modelflags");
        prog->fieldoffsets.movement                       = PRVM_ED_FindFieldOffset("movement");
        prog->fieldoffsets.netaddress                     = PRVM_ED_FindFieldOffset("netaddress");