From: vortex Date: Tue, 21 Sep 2010 21:49:23 +0000 (+0000) Subject: Fix GAME_XONOTIC beging misplaced in gamemode_t->gamemode_info causing "gamemode... X-Git-Tag: xonotic-v0.1.0preview~230^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4f738fb758eadca11d76db88b8db2e2d45f9e261;p=xonotic%2Fdarkplaces.git Fix GAME_XONOTIC beging misplaced in gamemode_t->gamemode_info causing "gamemode" to be initialized wrong. CSQC now knows "view_punchvector" and "view_punchangle" globals which is what it used to be. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10478 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/common.h b/common.h index f8cba1a3..0902ca77 100644 --- a/common.h +++ b/common.h @@ -252,6 +252,7 @@ typedef enum gamemode_e GAME_ROGUE, GAME_NEHAHRA, GAME_NEXUIZ, + GAME_XONOTIC, GAME_TRANSFUSION, GAME_GOODVSBAD2, GAME_TEU, @@ -273,7 +274,6 @@ typedef enum gamemode_e GAME_BLOODOMNICIDE, GAME_STEELSTORM, // added by motorsep GAME_STRAPBOMB, // added by motorsep for Urre - GAME_XONOTIC, GAME_COUNT } gamemode_t; diff --git a/csprogs.c b/csprogs.c index aa438a52..33f2987f 100644 --- a/csprogs.c +++ b/csprogs.c @@ -123,6 +123,10 @@ static void CSQC_SetGlobals (void) if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.view_angles))) VectorCopy(cl.viewangles, val->vector); + if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.view_punchangle))) + VectorCopy(cl.punchangle, val->vector); + if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.view_punchvector))) + VectorCopy(cl.punchvector, val->vector); prog->globals.client->maxclients = cl.maxclients; CSQC_END } diff --git a/dpdefs/csprogsdefs.qc b/dpdefs/csprogsdefs.qc index 2c2d0d1a..1a6847fc 100644 --- a/dpdefs/csprogsdefs.qc +++ b/dpdefs/csprogsdefs.qc @@ -147,6 +147,10 @@ void end_sys_fields; // flag for structure dumping // Additional OPTIONAL Fields and Globals float intermission; +vector view_angles; // same as input_angles +vector view_punchangle; +vector view_punchvector; + /* ============================================================================== diff --git a/progsvm.h b/progsvm.h index 85610510..5bf4080d 100644 --- a/progsvm.h +++ b/progsvm.h @@ -288,6 +288,8 @@ typedef struct prvm_prog_globaloffsets_s int v_right; // ssqc / csqc int v_up; // ssqc / csqc int view_angles; // csqc + int view_punchangle; // csqc + int view_punchvector; // csqc int trace_allsolid; // ssqc / csqc int trace_startsolid; // ssqc / csqc int trace_fraction; // ssqc / csqc diff --git a/prvm_edict.c b/prvm_edict.c index 793b75e2..7a81d008 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -1730,6 +1730,8 @@ void PRVM_FindOffsets(void) prog->globaloffsets.v_right = PRVM_ED_FindGlobalOffset("v_right"); prog->globaloffsets.v_up = PRVM_ED_FindGlobalOffset("v_up"); prog->globaloffsets.view_angles = PRVM_ED_FindGlobalOffset("view_angles"); + prog->globaloffsets.view_punchangle = PRVM_ED_FindGlobalOffset("view_punchangle"); + prog->globaloffsets.view_punchvector = PRVM_ED_FindGlobalOffset("view_punchvector"); prog->globaloffsets.worldstatus = PRVM_ED_FindGlobalOffset("worldstatus"); prog->globaloffsets.particles_alphamin = PRVM_ED_FindGlobalOffset("particles_alphamin"); prog->globaloffsets.particles_alphamax = PRVM_ED_FindGlobalOffset("particles_alphamax");