diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 686ec5aa2..1939c4a36 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -142,7 +142,6 @@ GAMEOBJS=$(OBJ)/game.$o \ $(OBJ)/config.$o \ $(OBJ)/gamedef.$o \ $(OBJ)/gameexec.$o \ - $(OBJ)/gamestructures.$o \ $(OBJ)/gamevars.$o \ $(OBJ)/global.$o \ $(OBJ)/menus.$o \ diff --git a/polymer/eduke32/Makefile.deps b/polymer/eduke32/Makefile.deps index dcf0cd899..ee6321e65 100644 --- a/polymer/eduke32/Makefile.deps +++ b/polymer/eduke32/Makefile.deps @@ -5,7 +5,7 @@ $(OBJ)/game.$o: $(SRC)/game.c $(SRC)/sync.c $(SRC)/jmact/scriplib.h $(duke3d_h) $(OBJ)/actors.$o: $(SRC)/actors.c $(duke3d_h) $(OBJ)/anim.$o: $(SRC)/anim.c $(duke3d_h) $(SRC)/jmact/animlib.h $(OBJ)/gamedef.$o: $(SRC)/gamedef.c $(duke3d_h) $(gamedef_h) -$(OBJ)/gameexec.$o: $(SRC)/gameexec.c $(duke3d_h) $(gamedef_h) +$(OBJ)/gameexec.$o: $(SRC)/gameexec.c $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h) $(OBJ)/gamestructures.$o: $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h) $(OBJ)/gamevars.$o: $(SRC)/gamevars.c $(duke3d_h) $(gamedef_h) $(OBJ)/global.$o: $(SRC)/*.c $(SRC)/global.c $(duke3d_h) diff --git a/polymer/eduke32/Makefile.msvc b/polymer/eduke32/Makefile.msvc index 294ee788c..5e3dba7e4 100644 --- a/polymer/eduke32/Makefile.msvc +++ b/polymer/eduke32/Makefile.msvc @@ -76,7 +76,6 @@ GAMEOBJS=$(OBJ)\game.$o \ $(OBJ)\anim.$o \ $(OBJ)\gamedef.$o \ $(OBJ)\gameexec.$o \ - $(OBJ)\gamestructures.$o \ $(OBJ)\gamevars.$o \ $(OBJ)\global.$o \ $(OBJ)\menus.$o \ diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 7dda80860..4d5375cb7 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -75,6 +75,7 @@ extern const memberlabel_t userdeflabels[]; extern const memberlabel_t InputLabels[]; extern const memberlabel_t TsprLabels[]; +/* extern void X_AccessUserdef(int iSet, int lLabelID, int lVar2); extern void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2); extern void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2); @@ -84,6 +85,7 @@ extern void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2); extern void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2); extern void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2); extern void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2); +*/ #define CON_ERROR OSD_ERROR "Line %d, %s: " diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 017a6066d..fdec7eb62 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -44,6 +44,8 @@ int g_tw; static int X_DoExecute(void); +#include "gamestructures.c" + void X_ScriptInfo(void) { if (script) diff --git a/polymer/eduke32/source/gamestructures.c b/polymer/eduke32/source/gamestructures.c index 0a827cf20..c11d2d7ae 100644 --- a/polymer/eduke32/source/gamestructures.c +++ b/polymer/eduke32/source/gamestructures.c @@ -21,15 +21,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //------------------------------------------------------------------------- - +/* #include "duke3d.h" #include "gamedef.h" #include "osd.h" - +*/ // this is all the crap for accessing the game's structs through the CON VM -void X_AccessUserdef(int iSet, int lLabelID, int lVar2) +static inline void X_AccessUserdef(int iSet, int lLabelID, int lVar2) { + int lValue=0; + if (g_p != myconnectindex) { // if (lVar2 == MAXGAMEVARS) @@ -38,12 +40,15 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) return; } + if (iSet) + lValue=Gv_GetVar(lVar2, g_i, g_p); + switch (lLabelID) { case USERDEFS_GOD: if (iSet) { - ud.god = Gv_GetVar(lVar2, g_i, g_p); + ud.god = lValue; return; } Gv_SetVar(lVar2, ud.god, g_i, g_p); @@ -52,7 +57,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_WARP_ON: if (iSet) { - ud.warp_on = Gv_GetVar(lVar2, g_i, g_p); + ud.warp_on = lValue; return; } Gv_SetVar(lVar2, ud.warp_on, g_i, g_p); @@ -61,7 +66,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_CASHMAN: if (iSet) { - ud.cashman = Gv_GetVar(lVar2, g_i, g_p); + ud.cashman = lValue; return; } Gv_SetVar(lVar2, ud.cashman, g_i, g_p); @@ -70,7 +75,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_EOG: if (iSet) { - ud.eog = Gv_GetVar(lVar2, g_i, g_p); + ud.eog = lValue; return; } Gv_SetVar(lVar2, ud.eog, g_i, g_p); @@ -79,7 +84,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_SHOWALLMAP: if (iSet) { - ud.showallmap = Gv_GetVar(lVar2, g_i, g_p); + ud.showallmap = lValue; return; } Gv_SetVar(lVar2, ud.showallmap, g_i, g_p); @@ -88,7 +93,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_SHOW_HELP: if (iSet) { - ud.show_help = Gv_GetVar(lVar2, g_i, g_p); + ud.show_help = lValue; return; } Gv_SetVar(lVar2, ud.show_help, g_i, g_p); @@ -97,7 +102,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_SCROLLMODE: if (iSet) { - ud.scrollmode = Gv_GetVar(lVar2, g_i, g_p); + ud.scrollmode = lValue; return; } Gv_SetVar(lVar2, ud.scrollmode, g_i, g_p); @@ -106,7 +111,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_CLIPPING: if (iSet) { - ud.clipping = Gv_GetVar(lVar2, g_i, g_p); + ud.clipping = lValue; return; } Gv_SetVar(lVar2, ud.clipping, g_i, g_p); @@ -115,7 +120,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) // case USERDEFS_USER_NAME: // if(iSet) // { - // ud.user_name[MAXPLAYERS][32] = Gv_GetVar(lVar2, g_i, g_p); + // ud.user_name[MAXPLAYERS][32] = lValue; // return; // } // Gv_SetVar(lVar2, ud.user_name[MAXPLAYERS][32], g_i, g_p); @@ -124,7 +129,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) // case USERDEFS_RIDECULE: // if(iSet) // { - // ud.ridecule = Gv_GetVar(lVar2, g_i, g_p); + // ud.ridecule = lValue; // return; // } // Gv_SetVar(lVar2, ud.ridecule, g_i, g_p); @@ -133,7 +138,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) // case USERDEFS_SAVEGAME: // if(iSet) // { - // ud.savegame = Gv_GetVar(lVar2, g_i, g_p); + // ud.savegame = lValue; // return; // } // Gv_SetVar(lVar2, ud.savegame, g_i, g_p); @@ -142,7 +147,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) // case USERDEFS_PWLOCKOUT: // if(iSet) // { - // ud.pwlockout = Gv_GetVar(lVar2, g_i, g_p); + // ud.pwlockout = lValue; // return; // } // Gv_SetVar(lVar2, ud.pwlockout, g_i, g_p); @@ -151,7 +156,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) // case USERDEFS_RTSNAME: // if(iSet) // { - // ud.rtsname = Gv_GetVar(lVar2, g_i, g_p); + // ud.rtsname = lValue; // return; // } // Gv_SetVar(lVar2, ud.rtsname, g_i, g_p); @@ -160,7 +165,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_OVERHEAD_ON: if (iSet) { - ud.overhead_on = Gv_GetVar(lVar2, g_i, g_p); + ud.overhead_on = lValue; return; } Gv_SetVar(lVar2, ud.overhead_on, g_i, g_p); @@ -169,7 +174,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_LAST_OVERHEAD: if (iSet) { - ud.last_overhead = Gv_GetVar(lVar2, g_i, g_p); + ud.last_overhead = lValue; return; } Gv_SetVar(lVar2, ud.last_overhead, g_i, g_p); @@ -178,7 +183,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_SHOWWEAPONS: if (iSet) { - ud.showweapons = Gv_GetVar(lVar2, g_i, g_p); + ud.showweapons = lValue; return; } Gv_SetVar(lVar2, ud.showweapons, g_i, g_p); @@ -187,7 +192,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_PAUSE_ON: if (iSet) { - ud.pause_on = Gv_GetVar(lVar2, g_i, g_p); + ud.pause_on = lValue; return; } Gv_SetVar(lVar2, ud.pause_on, g_i, g_p); @@ -196,7 +201,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_FROM_BONUS: if (iSet) { - ud.from_bonus = Gv_GetVar(lVar2, g_i, g_p); + ud.from_bonus = lValue; return; } Gv_SetVar(lVar2, ud.from_bonus, g_i, g_p); @@ -205,7 +210,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_CAMERASPRITE: if (iSet) { - ud.camerasprite = Gv_GetVar(lVar2, g_i, g_p); + ud.camerasprite = lValue; return; } Gv_SetVar(lVar2, ud.camerasprite, g_i, g_p); @@ -214,7 +219,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_LAST_CAMSPRITE: if (iSet) { - ud.last_camsprite = Gv_GetVar(lVar2, g_i, g_p); + ud.last_camsprite = lValue; return; } Gv_SetVar(lVar2, ud.last_camsprite, g_i, g_p); @@ -223,7 +228,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_LAST_LEVEL: if (iSet) { - ud.last_level = Gv_GetVar(lVar2, g_i, g_p); + ud.last_level = lValue; return; } Gv_SetVar(lVar2, ud.last_level, g_i, g_p); @@ -232,7 +237,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_SECRETLEVEL: if (iSet) { - ud.secretlevel = Gv_GetVar(lVar2, g_i, g_p); + ud.secretlevel = lValue; return; } Gv_SetVar(lVar2, ud.secretlevel, g_i, g_p); @@ -241,7 +246,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_CONST_VISIBILITY: if (iSet) { - ud.const_visibility = Gv_GetVar(lVar2, g_i, g_p); + ud.const_visibility = lValue; return; } Gv_SetVar(lVar2, ud.const_visibility, g_i, g_p); @@ -250,7 +255,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_UW_FRAMERATE: if (iSet) { - ud.uw_framerate = Gv_GetVar(lVar2, g_i, g_p); + ud.uw_framerate = lValue; return; } Gv_SetVar(lVar2, ud.uw_framerate, g_i, g_p); @@ -259,7 +264,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_CAMERA_TIME: if (iSet) { - ud.camera_time = Gv_GetVar(lVar2, g_i, g_p); + ud.camera_time = lValue; return; } Gv_SetVar(lVar2, ud.camera_time, g_i, g_p); @@ -268,7 +273,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_FOLFVEL: if (iSet) { - ud.folfvel = Gv_GetVar(lVar2, g_i, g_p); + ud.folfvel = lValue; return; } Gv_SetVar(lVar2, ud.folfvel, g_i, g_p); @@ -277,7 +282,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_FOLAVEL: if (iSet) { - ud.folavel = Gv_GetVar(lVar2, g_i, g_p); + ud.folavel = lValue; return; } Gv_SetVar(lVar2, ud.folavel, g_i, g_p); @@ -286,7 +291,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_FOLX: if (iSet) { - ud.folx = Gv_GetVar(lVar2, g_i, g_p); + ud.folx = lValue; return; } Gv_SetVar(lVar2, ud.folx, g_i, g_p); @@ -295,7 +300,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_FOLY: if (iSet) { - ud.foly = Gv_GetVar(lVar2, g_i, g_p); + ud.foly = lValue; return; } Gv_SetVar(lVar2, ud.foly, g_i, g_p); @@ -304,7 +309,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_FOLA: if (iSet) { - ud.fola = Gv_GetVar(lVar2, g_i, g_p); + ud.fola = lValue; return; } Gv_SetVar(lVar2, ud.fola, g_i, g_p); @@ -313,7 +318,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_RECCNT: if (iSet) { - ud.reccnt = Gv_GetVar(lVar2, g_i, g_p); + ud.reccnt = lValue; return; } Gv_SetVar(lVar2, ud.reccnt, g_i, g_p); @@ -322,7 +327,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_ENTERED_NAME: if (iSet) { - ud.entered_name = Gv_GetVar(lVar2, g_i, g_p); + ud.entered_name = lValue; return; } Gv_SetVar(lVar2, ud.entered_name, g_i, g_p); @@ -331,7 +336,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_SCREEN_TILTING: if (iSet) { - ud.screen_tilting = Gv_GetVar(lVar2, g_i, g_p); + ud.screen_tilting = lValue; return; } Gv_SetVar(lVar2, ud.screen_tilting, g_i, g_p); @@ -340,7 +345,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_SHADOWS: if (iSet) { - ud.shadows = Gv_GetVar(lVar2, g_i, g_p); + ud.shadows = lValue; return; } Gv_SetVar(lVar2, ud.shadows, g_i, g_p); @@ -349,7 +354,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_FTA_ON: if (iSet) { - ud.fta_on = Gv_GetVar(lVar2, g_i, g_p); + ud.fta_on = lValue; return; } Gv_SetVar(lVar2, ud.fta_on, g_i, g_p); @@ -358,7 +363,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_EXECUTIONS: if (iSet) { - ud.executions = Gv_GetVar(lVar2, g_i, g_p); + ud.executions = lValue; return; } Gv_SetVar(lVar2, ud.executions, g_i, g_p); @@ -367,7 +372,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_AUTO_RUN: if (iSet) { - ud.auto_run = Gv_GetVar(lVar2, g_i, g_p); + ud.auto_run = lValue; return; } Gv_SetVar(lVar2, ud.auto_run, g_i, g_p); @@ -376,7 +381,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_COORDS: if (iSet) { - ud.coords = Gv_GetVar(lVar2, g_i, g_p); + ud.coords = lValue; return; } Gv_SetVar(lVar2, ud.coords, g_i, g_p); @@ -385,7 +390,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_TICKRATE: if (iSet) { - ud.tickrate = Gv_GetVar(lVar2, g_i, g_p); + ud.tickrate = lValue; return; } Gv_SetVar(lVar2, ud.tickrate, g_i, g_p); @@ -394,7 +399,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_COOP: if (iSet) { - ud.m_coop = Gv_GetVar(lVar2, g_i, g_p); + ud.m_coop = lValue; return; } Gv_SetVar(lVar2, ud.m_coop, g_i, g_p); @@ -403,7 +408,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_COOP: if (iSet) { - ud.coop = Gv_GetVar(lVar2, g_i, g_p); + ud.coop = lValue; return; } Gv_SetVar(lVar2, ud.coop, g_i, g_p); @@ -412,7 +417,6 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_SCREEN_SIZE: if (iSet) { - int lValue = Gv_GetVar(lVar2, g_i, g_p); if (ud.screen_size != lValue) { ud.screen_size = lValue; @@ -426,7 +430,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_LOCKOUT: if (iSet) { - ud.lockout = Gv_GetVar(lVar2, g_i, g_p); + ud.lockout = lValue; return; } Gv_SetVar(lVar2, ud.lockout, g_i, g_p); @@ -435,7 +439,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_CROSSHAIR: if (iSet) { - ud.crosshair = Gv_GetVar(lVar2, g_i, g_p); + ud.crosshair = lValue; return; } Gv_SetVar(lVar2, ud.crosshair, g_i, g_p); @@ -444,7 +448,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) // case USERDEFS_WCHOICE: // if(iSet) // { - // ud.wchoice = Gv_GetVar(lVar2, g_i, g_p); + // ud.wchoice = lValue; // return; // } // Gv_SetVar(lVar2, ud.wchoice, g_i, g_p); @@ -453,7 +457,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_PLAYERAI: if (iSet) { - ud.playerai = Gv_GetVar(lVar2, g_i, g_p); + ud.playerai = lValue; return; } Gv_SetVar(lVar2, ud.playerai, g_i, g_p); @@ -462,7 +466,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_RESPAWN_MONSTERS: if (iSet) { - ud.respawn_monsters = Gv_GetVar(lVar2, g_i, g_p); + ud.respawn_monsters = lValue; return; } Gv_SetVar(lVar2, ud.respawn_monsters, g_i, g_p); @@ -471,7 +475,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_RESPAWN_ITEMS: if (iSet) { - ud.respawn_items = Gv_GetVar(lVar2, g_i, g_p); + ud.respawn_items = lValue; return; } Gv_SetVar(lVar2, ud.respawn_items, g_i, g_p); @@ -480,7 +484,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_RESPAWN_INVENTORY: if (iSet) { - ud.respawn_inventory = Gv_GetVar(lVar2, g_i, g_p); + ud.respawn_inventory = lValue; return; } Gv_SetVar(lVar2, ud.respawn_inventory, g_i, g_p); @@ -489,7 +493,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_RECSTAT: if (iSet) { - ud.recstat = Gv_GetVar(lVar2, g_i, g_p); + ud.recstat = lValue; return; } Gv_SetVar(lVar2, ud.recstat, g_i, g_p); @@ -498,7 +502,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_MONSTERS_OFF: if (iSet) { - ud.monsters_off = Gv_GetVar(lVar2, g_i, g_p); + ud.monsters_off = lValue; return; } Gv_SetVar(lVar2, ud.monsters_off, g_i, g_p); @@ -507,7 +511,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_BRIGHTNESS: if (iSet) { - ud.brightness = Gv_GetVar(lVar2, g_i, g_p); + ud.brightness = lValue; return; } Gv_SetVar(lVar2, ud.brightness, g_i, g_p); @@ -516,7 +520,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_RESPAWN_ITEMS: if (iSet) { - ud.m_respawn_items = Gv_GetVar(lVar2, g_i, g_p); + ud.m_respawn_items = lValue; return; } Gv_SetVar(lVar2, ud.m_respawn_items, g_i, g_p); @@ -525,7 +529,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_RESPAWN_MONSTERS: if (iSet) { - ud.m_respawn_monsters = Gv_GetVar(lVar2, g_i, g_p); + ud.m_respawn_monsters = lValue; return; } Gv_SetVar(lVar2, ud.m_respawn_monsters, g_i, g_p); @@ -534,7 +538,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_RESPAWN_INVENTORY: if (iSet) { - ud.m_respawn_inventory = Gv_GetVar(lVar2, g_i, g_p); + ud.m_respawn_inventory = lValue; return; } Gv_SetVar(lVar2, ud.m_respawn_inventory, g_i, g_p); @@ -543,7 +547,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_RECSTAT: if (iSet) { - ud.m_recstat = Gv_GetVar(lVar2, g_i, g_p); + ud.m_recstat = lValue; return; } Gv_SetVar(lVar2, ud.m_recstat, g_i, g_p); @@ -552,7 +556,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_MONSTERS_OFF: if (iSet) { - ud.m_monsters_off = Gv_GetVar(lVar2, g_i, g_p); + ud.m_monsters_off = lValue; return; } Gv_SetVar(lVar2, ud.m_monsters_off, g_i, g_p); @@ -561,7 +565,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_DETAIL: if (iSet) { - ud.detail = Gv_GetVar(lVar2, g_i, g_p); + ud.detail = lValue; return; } Gv_SetVar(lVar2, ud.detail, g_i, g_p); @@ -570,7 +574,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_FFIRE: if (iSet) { - ud.m_ffire = Gv_GetVar(lVar2, g_i, g_p); + ud.m_ffire = lValue; return; } Gv_SetVar(lVar2, ud.m_ffire, g_i, g_p); @@ -579,7 +583,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_FFIRE: if (iSet) { - ud.ffire = Gv_GetVar(lVar2, g_i, g_p); + ud.ffire = lValue; return; } Gv_SetVar(lVar2, ud.ffire, g_i, g_p); @@ -588,7 +592,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_PLAYER_SKILL: if (iSet) { - ud.m_player_skill = Gv_GetVar(lVar2, g_i, g_p); + ud.m_player_skill = lValue; return; } Gv_SetVar(lVar2, ud.m_player_skill, g_i, g_p); @@ -597,7 +601,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_LEVEL_NUMBER: if (iSet) { - ud.m_level_number = Gv_GetVar(lVar2, g_i, g_p); + ud.m_level_number = lValue; return; } Gv_SetVar(lVar2, ud.m_level_number, g_i, g_p); @@ -606,7 +610,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_VOLUME_NUMBER: if (iSet) { - ud.m_volume_number = Gv_GetVar(lVar2, g_i, g_p); + ud.m_volume_number = lValue; return; } Gv_SetVar(lVar2, ud.m_volume_number, g_i, g_p); @@ -615,7 +619,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_MULTIMODE: if (iSet) { - ud.multimode = Gv_GetVar(lVar2, g_i, g_p); + ud.multimode = lValue; return; } Gv_SetVar(lVar2, ud.multimode, g_i, g_p); @@ -624,7 +628,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_PLAYER_SKILL: if (iSet) { - ud.player_skill = Gv_GetVar(lVar2, g_i, g_p); + ud.player_skill = lValue; return; } Gv_SetVar(lVar2, ud.player_skill, g_i, g_p); @@ -633,7 +637,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_LEVEL_NUMBER: if (iSet) { - ud.level_number = Gv_GetVar(lVar2, g_i, g_p); + ud.level_number = lValue; return; } Gv_SetVar(lVar2, ud.level_number, g_i, g_p); @@ -642,7 +646,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_VOLUME_NUMBER: if (iSet) { - ud.volume_number = Gv_GetVar(lVar2, g_i, g_p); + ud.volume_number = lValue; return; } Gv_SetVar(lVar2, ud.volume_number, g_i, g_p); @@ -651,7 +655,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_MARKER: if (iSet) { - ud.m_marker = Gv_GetVar(lVar2, g_i, g_p); + ud.m_marker = lValue; return; } Gv_SetVar(lVar2, ud.m_marker, g_i, g_p); @@ -660,7 +664,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_MARKER: if (iSet) { - ud.marker = Gv_GetVar(lVar2, g_i, g_p); + ud.marker = lValue; return; } Gv_SetVar(lVar2, ud.marker, g_i, g_p); @@ -669,7 +673,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_MOUSEFLIP: if (iSet) { - ud.mouseflip = Gv_GetVar(lVar2, g_i, g_p); + ud.mouseflip = lValue; return; } Gv_SetVar(lVar2, ud.mouseflip, g_i, g_p); @@ -678,7 +682,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_STATUSBARSCALE: if (iSet) { - ud.statusbarscale = Gv_GetVar(lVar2, g_i, g_p); + ud.statusbarscale = lValue; return; } Gv_SetVar(lVar2, ud.statusbarscale, g_i, g_p); @@ -687,7 +691,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_DRAWWEAPON: if (iSet) { - ud.drawweapon = Gv_GetVar(lVar2, g_i, g_p); + ud.drawweapon = lValue; return; } Gv_SetVar(lVar2, ud.drawweapon, g_i, g_p); @@ -696,7 +700,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_MOUSEAIMING: if (iSet) { - ud.mouseaiming = Gv_GetVar(lVar2, g_i, g_p); + ud.mouseaiming = lValue; return; } Gv_SetVar(lVar2, ud.mouseaiming, g_i, g_p); @@ -705,7 +709,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_WEAPONSWITCH: if (iSet) { - ud.weaponswitch = Gv_GetVar(lVar2, g_i, g_p); + ud.weaponswitch = lValue; return; } Gv_SetVar(lVar2, ud.weaponswitch, g_i, g_p); @@ -714,7 +718,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_DEMOCAMS: if (iSet) { - ud.democams = Gv_GetVar(lVar2, g_i, g_p); + ud.democams = lValue; return; } Gv_SetVar(lVar2, ud.democams, g_i, g_p); @@ -723,7 +727,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_COLOR: if (iSet) { - ud.color = Gv_GetVar(lVar2, g_i, g_p); + ud.color = lValue; return; } Gv_SetVar(lVar2, ud.color, g_i, g_p); @@ -732,7 +736,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_MSGDISPTIME: if (iSet) { - ud.msgdisptime = Gv_GetVar(lVar2, g_i, g_p); + ud.msgdisptime = lValue; return; } Gv_SetVar(lVar2, ud.msgdisptime, g_i, g_p); @@ -741,7 +745,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_STATUSBARMODE: if (iSet) { - ud.statusbarmode = Gv_GetVar(lVar2, g_i, g_p); + ud.statusbarmode = lValue; return; } Gv_SetVar(lVar2, ud.statusbarmode, g_i, g_p); @@ -750,7 +754,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_M_NOEXITS: if (iSet) { - ud.m_noexits = Gv_GetVar(lVar2, g_i, g_p); + ud.m_noexits = lValue; return; } Gv_SetVar(lVar2, ud.m_noexits, g_i, g_p); @@ -759,7 +763,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_NOEXITS: if (iSet) { - ud.noexits = Gv_GetVar(lVar2, g_i, g_p); + ud.noexits = lValue; return; } Gv_SetVar(lVar2, ud.noexits, g_i, g_p); @@ -768,7 +772,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_AUTOVOTE: if (iSet) { - ud.autovote = Gv_GetVar(lVar2, g_i, g_p); + ud.autovote = lValue; return; } Gv_SetVar(lVar2, ud.autovote, g_i, g_p); @@ -777,7 +781,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_AUTOMSG: if (iSet) { - ud.automsg = Gv_GetVar(lVar2, g_i, g_p); + ud.automsg = lValue; return; } Gv_SetVar(lVar2, ud.automsg, g_i, g_p); @@ -786,7 +790,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_IDPLAYERS: if (iSet) { - ud.idplayers = Gv_GetVar(lVar2, g_i, g_p); + ud.idplayers = lValue; return; } Gv_SetVar(lVar2, ud.idplayers, g_i, g_p); @@ -795,7 +799,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_TEAM: if (iSet) { - ud.team = Gv_GetVar(lVar2, g_i, g_p); + ud.team = lValue; return; } Gv_SetVar(lVar2, ud.team, g_i, g_p); @@ -804,7 +808,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_VIEWBOB: if (iSet) { - ud.viewbob = Gv_GetVar(lVar2, g_i, g_p); + ud.viewbob = lValue; return; } Gv_SetVar(lVar2, ud.viewbob, g_i, g_p); @@ -813,7 +817,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_WEAPONSWAY: if (iSet) { - ud.weaponsway = Gv_GetVar(lVar2, g_i, g_p); + ud.weaponsway = lValue; return; } Gv_SetVar(lVar2, ud.weaponsway, g_i, g_p); @@ -822,7 +826,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_ANGLEINTERPOLATION: if (iSet) { - ud.angleinterpolation = Gv_GetVar(lVar2, g_i, g_p); + ud.angleinterpolation = lValue; return; } Gv_SetVar(lVar2, ud.angleinterpolation, g_i, g_p); @@ -831,7 +835,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_OBITUARIES: if (iSet) { - ud.obituaries = Gv_GetVar(lVar2, g_i, g_p); + ud.obituaries = lValue; return; } Gv_SetVar(lVar2, ud.obituaries, g_i, g_p); @@ -840,7 +844,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_LEVELSTATS: if (iSet) { - ud.levelstats = Gv_GetVar(lVar2, g_i, g_p); + ud.levelstats = lValue; return; } Gv_SetVar(lVar2, ud.levelstats, g_i, g_p); @@ -849,7 +853,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_CROSSHAIRSCALE: if (iSet) { - ud.crosshairscale = Gv_GetVar(lVar2, g_i, g_p); + ud.crosshairscale = lValue; return; } Gv_SetVar(lVar2, ud.crosshairscale, g_i, g_p); @@ -858,7 +862,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_ALTHUD: if (iSet) { - ud.althud = Gv_GetVar(lVar2, g_i, g_p); + ud.althud = lValue; return; } Gv_SetVar(lVar2, ud.althud, g_i, g_p); @@ -867,7 +871,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_DISPLAY_BONUS_SCREEN: if (iSet) { - ud.display_bonus_screen = Gv_GetVar(lVar2, g_i, g_p); + ud.display_bonus_screen = lValue; return; } Gv_SetVar(lVar2, ud.display_bonus_screen, g_i, g_p); @@ -876,7 +880,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_SHOW_LEVEL_TEXT: if (iSet) { - ud.show_level_text = Gv_GetVar(lVar2, g_i, g_p); + ud.show_level_text = lValue; return; } Gv_SetVar(lVar2, ud.show_level_text, g_i, g_p); @@ -885,7 +889,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_WEAPONSCALE: if (iSet) { - ud.weaponscale = Gv_GetVar(lVar2, g_i, g_p); + ud.weaponscale = lValue; return; } Gv_SetVar(lVar2, ud.weaponscale, g_i, g_p); @@ -894,7 +898,7 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) case USERDEFS_TEXTSCALE: if (iSet) { - ud.textscale = Gv_GetVar(lVar2, g_i, g_p); + ud.textscale = lValue; return; } Gv_SetVar(lVar2, ud.textscale, g_i, g_p); @@ -905,9 +909,9 @@ void X_AccessUserdef(int iSet, int lLabelID, int lVar2) } } -void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) +static inline void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) { - int proj=g_i; + int lValue=0,proj=g_i; if (lVar1 != g_iThisActorID) proj=Gv_GetVar(lVar1, g_i, g_p); @@ -922,12 +926,15 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) return; } + if (iSet) + lValue=Gv_GetVar(lVar2, g_i, g_p); + switch (lLabelID) { case PROJ_WORKSLIKE: if (iSet) { - ActorExtra[proj].projectile.workslike= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.workslike=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.workslike, g_i, g_p); @@ -936,7 +943,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_SPAWNS: if (iSet) { - ActorExtra[proj].projectile.spawns= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.spawns=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.spawns, g_i, g_p); @@ -945,7 +952,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_SXREPEAT: if (iSet) { - ActorExtra[proj].projectile.sxrepeat= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.sxrepeat=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.sxrepeat, g_i, g_p); @@ -954,7 +961,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_SYREPEAT: if (iSet) { - ActorExtra[proj].projectile.syrepeat= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.syrepeat=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.syrepeat, g_i, g_p); @@ -963,7 +970,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_SOUND: if (iSet) { - ActorExtra[proj].projectile.sound= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.sound=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.sound, g_i, g_p); @@ -972,7 +979,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_ISOUND: if (iSet) { - ActorExtra[proj].projectile.isound= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.isound=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.isound, g_i, g_p); @@ -981,7 +988,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_VEL: if (iSet) { - ActorExtra[proj].projectile.vel= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.vel=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.vel, g_i, g_p); @@ -990,7 +997,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_EXTRA: if (iSet) { - ActorExtra[proj].projectile.extra= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.extra=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.extra, g_i, g_p); @@ -999,7 +1006,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_DECAL: if (iSet) { - ActorExtra[proj].projectile.decal= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.decal=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.decal, g_i, g_p); @@ -1008,7 +1015,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_TRAIL: if (iSet) { - ActorExtra[proj].projectile.trail= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.trail=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.trail, g_i, g_p); @@ -1017,7 +1024,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_TXREPEAT: if (iSet) { - ActorExtra[proj].projectile.txrepeat= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.txrepeat=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.txrepeat, g_i, g_p); @@ -1026,7 +1033,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_TYREPEAT: if (iSet) { - ActorExtra[proj].projectile.tyrepeat= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.tyrepeat=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.tyrepeat, g_i, g_p); @@ -1035,7 +1042,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_TOFFSET: if (iSet) { - ActorExtra[proj].projectile.toffset= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.toffset=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.toffset, g_i, g_p); @@ -1044,7 +1051,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_TNUM: if (iSet) { - ActorExtra[proj].projectile.tnum= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.tnum=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.tnum, g_i, g_p); @@ -1053,7 +1060,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_DROP: if (iSet) { - ActorExtra[proj].projectile.drop= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.drop=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.drop, g_i, g_p); @@ -1062,7 +1069,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_CSTAT: if (iSet) { - ActorExtra[proj].projectile.cstat= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.cstat=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.cstat, g_i, g_p); @@ -1071,7 +1078,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_CLIPDIST: if (iSet) { - ActorExtra[proj].projectile.clipdist= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.clipdist=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.clipdist, g_i, g_p); @@ -1080,7 +1087,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_SHADE: if (iSet) { - ActorExtra[proj].projectile.shade= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.shade=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.shade, g_i, g_p); @@ -1089,7 +1096,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_XREPEAT: if (iSet) { - ActorExtra[proj].projectile.xrepeat= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.xrepeat=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.xrepeat, g_i, g_p); @@ -1098,7 +1105,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_YREPEAT: if (iSet) { - ActorExtra[proj].projectile.yrepeat= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.yrepeat=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.yrepeat, g_i, g_p); @@ -1107,7 +1114,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_PAL: if (iSet) { - ActorExtra[proj].projectile.pal= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.pal=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.pal, g_i, g_p); @@ -1116,7 +1123,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_EXTRA_RAND: if (iSet) { - ActorExtra[proj].projectile.extra_rand= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.extra_rand=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.extra_rand, g_i, g_p); @@ -1125,7 +1132,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_HITRADIUS: if (iSet) { - ActorExtra[proj].projectile.hitradius= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.hitradius=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.hitradius, g_i, g_p); @@ -1134,7 +1141,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_VEL_MULT: if (iSet) { - ActorExtra[proj].projectile.velmult= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.velmult=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.velmult, g_i, g_p); @@ -1143,7 +1150,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_OFFSET: if (iSet) { - ActorExtra[proj].projectile.offset= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.offset=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.offset, g_i, g_p); @@ -1152,7 +1159,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_BOUNCES: if (iSet) { - ActorExtra[proj].projectile.bounces= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.bounces=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.bounces, g_i, g_p); @@ -1161,7 +1168,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_BSOUND: if (iSet) { - ActorExtra[proj].projectile.bsound= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.bsound=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.bsound, g_i, g_p); @@ -1170,7 +1177,7 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_RANGE: if (iSet) { - ActorExtra[proj].projectile.range= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[proj].projectile.range=lValue; return; } Gv_SetVar(lVar2, ActorExtra[proj].projectile.range, g_i, g_p); @@ -1181,8 +1188,9 @@ void X_AccessActiveProjectile(int iSet, int lVar1, int lLabelID, int lVar2) } } -void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) +static inline void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) { + int lValue=0; int iPlayer=g_p; if (lVar1 != g_iThisActorID) @@ -1206,12 +1214,15 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) return; } + if (iSet) + lValue=Gv_GetVar(lVar2, g_i, g_p); + switch (lLabelID) { case PLAYER_ZOOM: if (iSet) { - g_player[iPlayer].ps->zoom= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->zoom=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->zoom, g_i, g_p); @@ -1220,7 +1231,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_EXITX: if (iSet) { - g_player[iPlayer].ps->exitx= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->exitx=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->exitx, g_i, g_p); @@ -1229,7 +1240,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_EXITY: if (iSet) { - g_player[iPlayer].ps->exity= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->exity=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->exity, g_i, g_p); @@ -1238,7 +1249,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_LOOGIEX: if (iSet) { - g_player[iPlayer].ps->loogiex[lParm2]= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->loogiex[lParm2]=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->loogiex[lParm2], g_i, g_p); @@ -1247,7 +1258,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_LOOGIEY: if (iSet) { - g_player[iPlayer].ps->loogiey[lParm2]= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->loogiey[lParm2]=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->loogiey[lParm2], g_i, g_p); @@ -1256,7 +1267,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_NUMLOOGS: if (iSet) { - g_player[iPlayer].ps->numloogs= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->numloogs=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->numloogs, g_i, g_p); @@ -1265,7 +1276,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_LOOGCNT: if (iSet) { - g_player[iPlayer].ps->loogcnt= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->loogcnt=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->loogcnt, g_i, g_p); @@ -1274,7 +1285,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_POSX: if (iSet) { - g_player[iPlayer].ps->posx= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->posx=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->posx, g_i, g_p); @@ -1283,7 +1294,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_POSY: if (iSet) { - g_player[iPlayer].ps->posy= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->posy=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->posy, g_i, g_p); @@ -1292,7 +1303,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_POSZ: if (iSet) { - g_player[iPlayer].ps->posz= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->posz=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->posz, g_i, g_p); @@ -1301,7 +1312,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HORIZ: if (iSet) { - g_player[iPlayer].ps->horiz= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->horiz=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->horiz, g_i, g_p); @@ -1310,7 +1321,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_OHORIZ: if (iSet) { - g_player[iPlayer].ps->ohoriz= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->ohoriz=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->ohoriz, g_i, g_p); @@ -1319,7 +1330,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_OHORIZOFF: if (iSet) { - g_player[iPlayer].ps->ohorizoff= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->ohorizoff=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->ohorizoff, g_i, g_p); @@ -1328,7 +1339,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_INVDISPTIME: if (iSet) { - g_player[iPlayer].ps->invdisptime= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->invdisptime=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->invdisptime, g_i, g_p); @@ -1337,7 +1348,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_BOBPOSX: if (iSet) { - g_player[iPlayer].ps->bobposx= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->bobposx=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->bobposx, g_i, g_p); @@ -1346,7 +1357,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_BOBPOSY: if (iSet) { - g_player[iPlayer].ps->bobposy= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->bobposy=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->bobposy, g_i, g_p); @@ -1355,7 +1366,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_OPOSX: if (iSet) { - g_player[iPlayer].ps->oposx= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->oposx=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->oposx, g_i, g_p); @@ -1364,7 +1375,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_OPOSY: if (iSet) { - g_player[iPlayer].ps->oposy= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->oposy=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->oposy, g_i, g_p); @@ -1373,7 +1384,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_OPOSZ: if (iSet) { - g_player[iPlayer].ps->oposz= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->oposz=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->oposz, g_i, g_p); @@ -1382,7 +1393,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_PYOFF: if (iSet) { - g_player[iPlayer].ps->pyoff= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->pyoff=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->pyoff, g_i, g_p); @@ -1391,7 +1402,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_OPYOFF: if (iSet) { - g_player[iPlayer].ps->opyoff= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->opyoff=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->opyoff, g_i, g_p); @@ -1400,7 +1411,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_POSXV: if (iSet) { - g_player[iPlayer].ps->posxv= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->posxv=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->posxv, g_i, g_p); @@ -1409,7 +1420,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_POSYV: if (iSet) { - g_player[iPlayer].ps->posyv= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->posyv=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->posyv, g_i, g_p); @@ -1418,7 +1429,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_POSZV: if (iSet) { - g_player[iPlayer].ps->poszv= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->poszv=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->poszv, g_i, g_p); @@ -1427,7 +1438,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_LAST_PISSED_TIME: if (iSet) { - g_player[iPlayer].ps->last_pissed_time= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->last_pissed_time=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->last_pissed_time, g_i, g_p); @@ -1436,7 +1447,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_TRUEFZ: if (iSet) { - g_player[iPlayer].ps->truefz= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->truefz=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->truefz, g_i, g_p); @@ -1445,7 +1456,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_TRUECZ: if (iSet) { - g_player[iPlayer].ps->truecz= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->truecz=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->truecz, g_i, g_p); @@ -1454,7 +1465,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_PLAYER_PAR: if (iSet) { - g_player[iPlayer].ps->player_par= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->player_par=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->player_par, g_i, g_p); @@ -1463,7 +1474,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_VISIBILITY: if (iSet) { - g_player[iPlayer].ps->visibility= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->visibility=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->visibility, g_i, g_p); @@ -1472,7 +1483,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_BOBCOUNTER: if (iSet) { - g_player[iPlayer].ps->bobcounter= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->bobcounter=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->bobcounter, g_i, g_p); @@ -1481,7 +1492,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_WEAPON_SWAY: if (iSet) { - g_player[iPlayer].ps->weapon_sway= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->weapon_sway=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->weapon_sway, g_i, g_p); @@ -1490,7 +1501,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_PALS_TIME: if (iSet) { - g_player[iPlayer].ps->pals_time= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->pals_time=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->pals_time, g_i, g_p); @@ -1499,7 +1510,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_RANDOMFLAMEX: if (iSet) { - g_player[iPlayer].ps->randomflamex= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->randomflamex=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->randomflamex, g_i, g_p); @@ -1508,7 +1519,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_CRACK_TIME: if (iSet) { - g_player[iPlayer].ps->crack_time= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->crack_time=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->crack_time, g_i, g_p); @@ -1517,7 +1528,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_AIM_MODE: if (iSet) { - g_player[iPlayer].ps->aim_mode= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->aim_mode=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->aim_mode, g_i, g_p); @@ -1526,7 +1537,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ANG: if (iSet) { - g_player[iPlayer].ps->ang= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->ang=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->ang, g_i, g_p); @@ -1535,7 +1546,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_OANG: if (iSet) { - g_player[iPlayer].ps->oang= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->oang=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->oang, g_i, g_p); @@ -1544,7 +1555,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ANGVEL: if (iSet) { - g_player[iPlayer].ps->angvel= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->angvel=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->angvel, g_i, g_p); @@ -1553,7 +1564,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_CURSECTNUM: if (iSet) { - g_player[iPlayer].ps->cursectnum= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->cursectnum=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->cursectnum, g_i, g_p); @@ -1562,7 +1573,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_LOOK_ANG: if (iSet) { - g_player[iPlayer].ps->look_ang= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->look_ang=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->look_ang, g_i, g_p); @@ -1571,7 +1582,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_LAST_EXTRA: if (iSet) { - g_player[iPlayer].ps->last_extra= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->last_extra=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->last_extra, g_i, g_p); @@ -1580,7 +1591,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SUBWEAPON: if (iSet) { - g_player[iPlayer].ps->subweapon= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->subweapon=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->subweapon, g_i, g_p); @@ -1589,7 +1600,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_AMMO_AMOUNT: if (iSet) { - g_player[iPlayer].ps->ammo_amount[lParm2]= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->ammo_amount[lParm2]=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->ammo_amount[lParm2], g_i, g_p); @@ -1598,7 +1609,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_WACKEDBYACTOR: if (iSet) { - g_player[iPlayer].ps->wackedbyactor= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->wackedbyactor=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->wackedbyactor, g_i, g_p); @@ -1607,7 +1618,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FRAG: if (iSet) { - g_player[iPlayer].ps->frag= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->frag=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->frag, g_i, g_p); @@ -1616,7 +1627,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FRAGGEDSELF: if (iSet) { - g_player[iPlayer].ps->fraggedself= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->fraggedself=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->fraggedself, g_i, g_p); @@ -1625,7 +1636,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_CURR_WEAPON: if (iSet) { - g_player[iPlayer].ps->curr_weapon= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->curr_weapon=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->curr_weapon, g_i, g_p); @@ -1634,7 +1645,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_LAST_WEAPON: if (iSet) { - g_player[iPlayer].ps->last_weapon= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->last_weapon=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->last_weapon, g_i, g_p); @@ -1643,7 +1654,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_TIPINCS: if (iSet) { - g_player[iPlayer].ps->tipincs= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->tipincs=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->tipincs, g_i, g_p); @@ -1652,7 +1663,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HORIZOFF: if (iSet) { - g_player[iPlayer].ps->horizoff= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->horizoff=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->horizoff, g_i, g_p); @@ -1661,7 +1672,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_WANTWEAPONFIRE: if (iSet) { - g_player[iPlayer].ps->wantweaponfire= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->wantweaponfire=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->wantweaponfire, g_i, g_p); @@ -1670,7 +1681,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HOLODUKE_AMOUNT: if (iSet) { - g_player[iPlayer].ps->holoduke_amount= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->holoduke_amount=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->holoduke_amount, g_i, g_p); @@ -1679,7 +1690,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_NEWOWNER: if (iSet) { - g_player[iPlayer].ps->newowner= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->newowner=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->newowner, g_i, g_p); @@ -1688,7 +1699,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HURT_DELAY: if (iSet) { - g_player[iPlayer].ps->hurt_delay= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->hurt_delay=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->hurt_delay, g_i, g_p); @@ -1697,7 +1708,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HBOMB_HOLD_DELAY: if (iSet) { - g_player[iPlayer].ps->hbomb_hold_delay= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->hbomb_hold_delay=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->hbomb_hold_delay, g_i, g_p); @@ -1706,7 +1717,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_JUMPING_COUNTER: if (iSet) { - g_player[iPlayer].ps->jumping_counter= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->jumping_counter=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->jumping_counter, g_i, g_p); @@ -1715,7 +1726,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_AIRLEFT: if (iSet) { - g_player[iPlayer].ps->airleft= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->airleft=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->airleft, g_i, g_p); @@ -1724,7 +1735,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_KNEE_INCS: if (iSet) { - g_player[iPlayer].ps->knee_incs= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->knee_incs=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->knee_incs, g_i, g_p); @@ -1733,7 +1744,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ACCESS_INCS: if (iSet) { - g_player[iPlayer].ps->access_incs= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->access_incs=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->access_incs, g_i, g_p); @@ -1742,7 +1753,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FTA: if (iSet) { - g_player[iPlayer].ps->fta= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->fta=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->fta, g_i, g_p); @@ -1751,7 +1762,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FTQ: if (iSet) { - g_player[iPlayer].ps->ftq= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->ftq=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->ftq, g_i, g_p); @@ -1760,7 +1771,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ACCESS_WALLNUM: if (iSet) { - g_player[iPlayer].ps->access_wallnum= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->access_wallnum=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->access_wallnum, g_i, g_p); @@ -1769,7 +1780,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ACCESS_SPRITENUM: if (iSet) { - g_player[iPlayer].ps->access_spritenum= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->access_spritenum=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->access_spritenum, g_i, g_p); @@ -1778,7 +1789,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_KICKBACK_PIC: if (iSet) { - g_player[iPlayer].ps->kickback_pic= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->kickback_pic=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->kickback_pic, g_i, g_p); @@ -1787,7 +1798,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_GOT_ACCESS: if (iSet) { - g_player[iPlayer].ps->got_access= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->got_access=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->got_access, g_i, g_p); @@ -1796,7 +1807,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_WEAPON_ANG: if (iSet) { - g_player[iPlayer].ps->weapon_ang= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->weapon_ang=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->weapon_ang, g_i, g_p); @@ -1805,7 +1816,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FIRSTAID_AMOUNT: if (iSet) { - g_player[iPlayer].ps->firstaid_amount= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->firstaid_amount=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->firstaid_amount, g_i, g_p); @@ -1814,7 +1825,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SOMETHINGONPLAYER: if (iSet) { - g_player[iPlayer].ps->somethingonplayer= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->somethingonplayer=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->somethingonplayer, g_i, g_p); @@ -1823,7 +1834,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ON_CRANE: if (iSet) { - g_player[iPlayer].ps->on_crane= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->on_crane=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->on_crane, g_i, g_p); @@ -1832,7 +1843,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_I: if (iSet) { - g_player[iPlayer].ps->i= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->i=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->i, g_i, g_p); @@ -1841,7 +1852,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ONE_PARALLAX_SECTNUM: if (iSet) { - g_player[iPlayer].ps->one_parallax_sectnum= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->one_parallax_sectnum=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->one_parallax_sectnum, g_i, g_p); @@ -1850,7 +1861,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_OVER_SHOULDER_ON: if (iSet) { - g_player[iPlayer].ps->over_shoulder_on= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->over_shoulder_on=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->over_shoulder_on, g_i, g_p); @@ -1859,7 +1870,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_RANDOM_CLUB_FRAME: if (iSet) { - g_player[iPlayer].ps->random_club_frame= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->random_club_frame=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->random_club_frame, g_i, g_p); @@ -1868,7 +1879,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FIST_INCS: if (iSet) { - g_player[iPlayer].ps->fist_incs= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->fist_incs=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->fist_incs, g_i, g_p); @@ -1877,7 +1888,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ONE_EIGHTY_COUNT: if (iSet) { - g_player[iPlayer].ps->one_eighty_count= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->one_eighty_count=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->one_eighty_count, g_i, g_p); @@ -1886,7 +1897,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_CHEAT_PHASE: if (iSet) { - g_player[iPlayer].ps->cheat_phase= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->cheat_phase=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->cheat_phase, g_i, g_p); @@ -1895,7 +1906,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_DUMMYPLAYERSPRITE: if (iSet) { - g_player[iPlayer].ps->dummyplayersprite= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->dummyplayersprite=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->dummyplayersprite, g_i, g_p); @@ -1904,7 +1915,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_EXTRA_EXTRA8: if (iSet) { - g_player[iPlayer].ps->extra_extra8= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->extra_extra8=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->extra_extra8, g_i, g_p); @@ -1913,7 +1924,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_QUICK_KICK: if (iSet) { - g_player[iPlayer].ps->quick_kick= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->quick_kick=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->quick_kick, g_i, g_p); @@ -1922,7 +1933,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HEAT_AMOUNT: if (iSet) { - g_player[iPlayer].ps->heat_amount= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->heat_amount=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->heat_amount, g_i, g_p); @@ -1931,7 +1942,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ACTORSQU: if (iSet) { - g_player[iPlayer].ps->actorsqu= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->actorsqu=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->actorsqu, g_i, g_p); @@ -1940,7 +1951,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_TIMEBEFOREEXIT: if (iSet) { - g_player[iPlayer].ps->timebeforeexit= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->timebeforeexit=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->timebeforeexit, g_i, g_p); @@ -1949,7 +1960,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_CUSTOMEXITSOUND: if (iSet) { - g_player[iPlayer].ps->customexitsound= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->customexitsound=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->customexitsound, g_i, g_p); @@ -1958,7 +1969,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_WEAPRECS: if (iSet) { - g_player[iPlayer].ps->weaprecs[15]= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->weaprecs[15]=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->weaprecs[15], g_i, g_p); @@ -1967,7 +1978,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_WEAPRECCNT: if (iSet) { - g_player[iPlayer].ps->weapreccnt= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->weapreccnt=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->weapreccnt, g_i, g_p); @@ -1976,7 +1987,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_INTERFACE_TOGGLE_FLAG: if (iSet) { - g_player[iPlayer].ps->interface_toggle_flag= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->interface_toggle_flag=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->interface_toggle_flag, g_i, g_p); @@ -1985,7 +1996,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ROTSCRNANG: if (iSet) { - g_player[iPlayer].ps->rotscrnang= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->rotscrnang=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->rotscrnang, g_i, g_p); @@ -1994,7 +2005,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_DEAD_FLAG: if (iSet) { - g_player[iPlayer].ps->dead_flag= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->dead_flag=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->dead_flag, g_i, g_p); @@ -2003,7 +2014,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SHOW_EMPTY_WEAPON: if (iSet) { - g_player[iPlayer].ps->show_empty_weapon= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->show_empty_weapon=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->show_empty_weapon, g_i, g_p); @@ -2012,7 +2023,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SCUBA_AMOUNT: if (iSet) { - g_player[iPlayer].ps->scuba_amount= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->scuba_amount=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->scuba_amount, g_i, g_p); @@ -2021,7 +2032,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_JETPACK_AMOUNT: if (iSet) { - g_player[iPlayer].ps->jetpack_amount= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->jetpack_amount=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->jetpack_amount, g_i, g_p); @@ -2030,7 +2041,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_STEROIDS_AMOUNT: if (iSet) { - g_player[iPlayer].ps->steroids_amount= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->steroids_amount=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->steroids_amount, g_i, g_p); @@ -2039,7 +2050,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SHIELD_AMOUNT: if (iSet) { - g_player[iPlayer].ps->shield_amount= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->shield_amount=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->shield_amount, g_i, g_p); @@ -2048,7 +2059,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HOLODUKE_ON: if (iSet) { - g_player[iPlayer].ps->holoduke_on= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->holoduke_on=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->holoduke_on, g_i, g_p); @@ -2057,7 +2068,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_PYCOUNT: if (iSet) { - g_player[iPlayer].ps->pycount= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->pycount=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->pycount, g_i, g_p); @@ -2066,7 +2077,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_WEAPON_POS: if (iSet) { - g_player[iPlayer].ps->weapon_pos= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->weapon_pos=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->weapon_pos, g_i, g_p); @@ -2075,7 +2086,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FRAG_PS: if (iSet) { - g_player[iPlayer].ps->frag_ps= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->frag_ps=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->frag_ps, g_i, g_p); @@ -2084,7 +2095,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_TRANSPORTER_HOLD: if (iSet) { - g_player[iPlayer].ps->transporter_hold= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->transporter_hold=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->transporter_hold, g_i, g_p); @@ -2093,7 +2104,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_LAST_FULL_WEAPON: if (iSet) { - g_player[iPlayer].ps->last_full_weapon= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->last_full_weapon=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->last_full_weapon, g_i, g_p); @@ -2102,7 +2113,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FOOTPRINTSHADE: if (iSet) { - g_player[iPlayer].ps->footprintshade= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->footprintshade=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->footprintshade, g_i, g_p); @@ -2111,7 +2122,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_BOOT_AMOUNT: if (iSet) { - g_player[iPlayer].ps->boot_amount= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->boot_amount=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->boot_amount, g_i, g_p); @@ -2120,7 +2131,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SCREAM_VOICE: if (iSet) { - g_player[iPlayer].ps->scream_voice= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->scream_voice=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->scream_voice, g_i, g_p); @@ -2129,7 +2140,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_GM: if (iSet) { - g_player[iPlayer].ps->gm= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->gm=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->gm, g_i, g_p); @@ -2138,7 +2149,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ON_WARPING_SECTOR: if (iSet) { - g_player[iPlayer].ps->on_warping_sector= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->on_warping_sector=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->on_warping_sector, g_i, g_p); @@ -2147,7 +2158,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FOOTPRINTCOUNT: if (iSet) { - g_player[iPlayer].ps->footprintcount= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->footprintcount=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->footprintcount, g_i, g_p); @@ -2156,7 +2167,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HBOMB_ON: if (iSet) { - g_player[iPlayer].ps->hbomb_on= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->hbomb_on=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->hbomb_on, g_i, g_p); @@ -2165,7 +2176,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_JUMPING_TOGGLE: if (iSet) { - g_player[iPlayer].ps->jumping_toggle= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->jumping_toggle=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->jumping_toggle, g_i, g_p); @@ -2174,7 +2185,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_RAPID_FIRE_HOLD: if (iSet) { - g_player[iPlayer].ps->rapid_fire_hold= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->rapid_fire_hold=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->rapid_fire_hold, g_i, g_p); @@ -2183,7 +2194,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ON_GROUND: if (iSet) { - g_player[iPlayer].ps->on_ground= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->on_ground=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->on_ground, g_i, g_p); @@ -2192,7 +2203,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) /* case PLAYER_NAME: if (iSet) { - g_player[iPlayer].ps->name[32]= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->name[32]=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->name[32], g_i, g_p); @@ -2201,7 +2212,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_INVEN_ICON: if (iSet) { - g_player[iPlayer].ps->inven_icon= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->inven_icon=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->inven_icon, g_i, g_p); @@ -2210,7 +2221,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_BUTTONPALETTE: if (iSet) { - g_player[iPlayer].ps->buttonpalette= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->buttonpalette=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->buttonpalette, g_i, g_p); @@ -2219,7 +2230,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_JETPACK_ON: if (iSet) { - g_player[iPlayer].ps->jetpack_on= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->jetpack_on=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->jetpack_on, g_i, g_p); @@ -2228,7 +2239,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SPRITEBRIDGE: if (iSet) { - g_player[iPlayer].ps->spritebridge= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->spritebridge=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->spritebridge, g_i, g_p); @@ -2237,7 +2248,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_LASTRANDOMSPOT: if (iSet) { - g_player[iPlayer].ps->lastrandomspot= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->lastrandomspot=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->lastrandomspot, g_i, g_p); @@ -2246,7 +2257,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SCUBA_ON: if (iSet) { - g_player[iPlayer].ps->scuba_on= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->scuba_on=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->scuba_on, g_i, g_p); @@ -2255,7 +2266,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FOOTPRINTPAL: if (iSet) { - g_player[iPlayer].ps->footprintpal= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->footprintpal=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->footprintpal, g_i, g_p); @@ -2264,11 +2275,12 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HEAT_ON: if (iSet) { - int lValue = Gv_GetVar(lVar2, g_i, g_p); - if (g_player[iPlayer].ps->heat_on != lValue) { - g_player[iPlayer].ps->heat_on= lValue; - P_UpdateScreenPal(g_player[iPlayer].ps); + if (g_player[iPlayer].ps->heat_on != lValue) + { + g_player[iPlayer].ps->heat_on=lValue; + P_UpdateScreenPal(g_player[iPlayer].ps); + } } return; } @@ -2278,7 +2290,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HOLSTER_WEAPON: if (iSet) { - g_player[iPlayer].ps->holster_weapon= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->holster_weapon=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->holster_weapon, g_i, g_p); @@ -2287,7 +2299,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_FALLING_COUNTER: if (iSet) { - g_player[iPlayer].ps->falling_counter= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->falling_counter=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->falling_counter, g_i, g_p); @@ -2296,7 +2308,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_GOTWEAPON: if (iSet) { - g_player[iPlayer].ps->gotweapon[lParm2]= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->gotweapon[lParm2]=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->gotweapon[lParm2], g_i, g_p); @@ -2305,7 +2317,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_REFRESH_INVENTORY: if (iSet) { - g_player[iPlayer].ps->refresh_inventory= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->refresh_inventory=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->refresh_inventory, g_i, g_p); @@ -2314,7 +2326,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) // case PLAYER_PALETTE: // if(iSet) // { - // g_player[iPlayer].ps->palette= Gv_GetVar(lVar2, g_i, g_p); + // g_player[iPlayer].ps->palette=lValue; // } // return; } // { @@ -2325,7 +2337,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_TOGGLE_KEY_FLAG: if (iSet) { - g_player[iPlayer].ps->toggle_key_flag= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->toggle_key_flag=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->toggle_key_flag, g_i, g_p); @@ -2334,7 +2346,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_KNUCKLE_INCS: if (iSet) { - g_player[iPlayer].ps->knuckle_incs= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->knuckle_incs=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->knuckle_incs, g_i, g_p); @@ -2343,7 +2355,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_WALKING_SND_TOGGLE: if (iSet) { - g_player[iPlayer].ps->walking_snd_toggle= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->walking_snd_toggle=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->walking_snd_toggle, g_i, g_p); @@ -2352,7 +2364,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_PALOOKUP: if (iSet) { - g_player[iPlayer].ps->palookup= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->palookup=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->palookup, g_i, g_p); @@ -2361,7 +2373,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_HARD_LANDING: if (iSet) { - g_player[iPlayer].ps->hard_landing= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->hard_landing=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->hard_landing, g_i, g_p); @@ -2370,7 +2382,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_MAX_SECRET_ROOMS: if (iSet) { - g_player[iPlayer].ps->max_secret_rooms= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->max_secret_rooms=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->max_secret_rooms, g_i, g_p); @@ -2379,7 +2391,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SECRET_ROOMS: if (iSet) { - g_player[iPlayer].ps->secret_rooms= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->secret_rooms=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->secret_rooms, g_i, g_p); @@ -2388,7 +2400,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_PALS: if (iSet) { - g_player[iPlayer].ps->pals[lParm2]= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->pals[lParm2]=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->pals[lParm2], g_i, g_p); @@ -2397,7 +2409,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_MAX_ACTORS_KILLED: if (iSet) { - g_player[iPlayer].ps->max_actors_killed= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->max_actors_killed=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->max_actors_killed, g_i, g_p); @@ -2406,7 +2418,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_ACTORS_KILLED: if (iSet) { - g_player[iPlayer].ps->actors_killed= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->actors_killed=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->actors_killed, g_i, g_p); @@ -2415,7 +2427,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_RETURN_TO_CENTER: if (iSet) { - g_player[iPlayer].ps->return_to_center= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->return_to_center=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->return_to_center, g_i, g_p); @@ -2424,7 +2436,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_RUNSPEED: if (iSet) { - g_player[iPlayer].ps->runspeed= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->runspeed=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->runspeed, g_i, g_p); @@ -2433,7 +2445,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SBS: if (iSet) { - g_player[iPlayer].ps->sbs= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->sbs=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->sbs, g_i, g_p); @@ -2442,7 +2454,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_RELOADING: if (iSet) { - g_player[iPlayer].ps->reloading= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->reloading=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->reloading, g_i, g_p); @@ -2451,7 +2463,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_AUTO_AIM: if (iSet) { - g_player[iPlayer].ps->auto_aim= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->auto_aim=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->auto_aim, g_i, g_p); @@ -2460,7 +2472,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_MOVEMENT_LOCK: if (iSet) { - g_player[iPlayer].ps->movement_lock= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->movement_lock=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->movement_lock, g_i, g_p); @@ -2469,7 +2481,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_SOUND_PITCH: if (iSet) { - g_player[iPlayer].ps->sound_pitch= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->sound_pitch=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->sound_pitch, g_i, g_p); @@ -2478,7 +2490,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_WEAPONSWITCH: if (iSet) { - g_player[iPlayer].ps->weaponswitch= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->weaponswitch=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->weaponswitch, g_i, g_p); @@ -2487,7 +2499,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_TEAM: if (iSet) { - g_player[iPlayer].ps->team= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->team=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->team, g_i, g_p); @@ -2496,7 +2508,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_MAX_PLAYER_HEALTH: if (iSet) { - g_player[iPlayer].ps->max_player_health = Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->max_player_health = lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->max_player_health, g_i, g_p); @@ -2505,7 +2517,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_MAX_SHIELD_AMOUNT: if (iSet) { - g_player[iPlayer].ps->max_shield_amount = Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->max_shield_amount = lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->max_shield_amount, g_i, g_p); @@ -2514,7 +2526,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_MAX_AMMO_AMOUNT: if (iSet) { - g_player[iPlayer].ps->max_ammo_amount[lParm2]= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->max_ammo_amount[lParm2]=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->max_ammo_amount[lParm2], g_i, g_p); @@ -2523,7 +2535,7 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case PLAYER_LAST_QUICK_KICK: if (iSet) { - g_player[iPlayer].ps->last_quick_kick= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].ps->last_quick_kick=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].ps->last_quick_kick, g_i, g_p); @@ -2534,8 +2546,9 @@ void X_AccessPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) } } -void X_AccessPlayerInput(int iSet, int lVar1, int lLabelID, int lVar2) +static inline void X_AccessPlayerInput(int iSet, int lVar1, int lLabelID, int lVar2) { + int lValue=0; int iPlayer=g_p; if (lVar1 != g_iThisActorID) @@ -2548,12 +2561,15 @@ void X_AccessPlayerInput(int iSet, int lVar1, int lLabelID, int lVar2) return; } + if (iSet) + lValue=Gv_GetVar(lVar2, g_i, g_p); + switch (lLabelID) { case INPUT_AVEL: if (iSet) { - g_player[iPlayer].sync->avel= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].sync->avel=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].sync->avel, g_i, g_p); @@ -2562,7 +2578,7 @@ void X_AccessPlayerInput(int iSet, int lVar1, int lLabelID, int lVar2) case INPUT_HORZ: if (iSet) { - g_player[iPlayer].sync->horz= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].sync->horz=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].sync->horz, g_i, g_p); @@ -2571,7 +2587,7 @@ void X_AccessPlayerInput(int iSet, int lVar1, int lLabelID, int lVar2) case INPUT_FVEL: if (iSet) { - g_player[iPlayer].sync->fvel= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].sync->fvel=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].sync->fvel, g_i, g_p); @@ -2580,7 +2596,7 @@ void X_AccessPlayerInput(int iSet, int lVar1, int lLabelID, int lVar2) case INPUT_SVEL: if (iSet) { - g_player[iPlayer].sync->svel= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].sync->svel=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].sync->svel, g_i, g_p); @@ -2589,7 +2605,7 @@ void X_AccessPlayerInput(int iSet, int lVar1, int lLabelID, int lVar2) case INPUT_BITS: if (iSet) { - g_player[iPlayer].sync->bits= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].sync->bits=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].sync->bits, g_i, g_p); @@ -2598,7 +2614,7 @@ void X_AccessPlayerInput(int iSet, int lVar1, int lLabelID, int lVar2) case INPUT_EXTBITS: if (iSet) { - g_player[iPlayer].sync->extbits= Gv_GetVar(lVar2, g_i, g_p); + g_player[iPlayer].sync->extbits=lValue; return; } Gv_SetVar(lVar2, g_player[iPlayer].sync->extbits, g_i, g_p); @@ -2608,8 +2624,9 @@ void X_AccessPlayerInput(int iSet, int lVar1, int lLabelID, int lVar2) } } -void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) +static inline void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) { + int lValue=0; int iWall = Gv_GetVar(lVar1, g_i, g_p); if ((iWall<0 || iWall >= numwalls) && g_scriptSanityChecks) @@ -2619,12 +2636,15 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) return; } + if (iSet) + lValue=Gv_GetVar(lVar2, g_i, g_p); + switch (lLabelID) { case WALL_X: if (iSet) { - wall[iWall].x= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].x=lValue; return; } Gv_SetVar(lVar2, wall[iWall].x, g_i, g_p); @@ -2633,7 +2653,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_Y: if (iSet) { - wall[iWall].y= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].y=lValue; return; } Gv_SetVar(lVar2, wall[iWall].y, g_i, g_p); @@ -2642,7 +2662,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_POINT2: if (iSet) { - wall[iWall].point2= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].point2=lValue; return; } Gv_SetVar(lVar2, wall[iWall].point2, g_i, g_p); @@ -2651,7 +2671,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_NEXTWALL: if (iSet) { - wall[iWall].nextwall= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].nextwall=lValue; return; } Gv_SetVar(lVar2, wall[iWall].nextwall, g_i, g_p); @@ -2660,7 +2680,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_NEXTSECTOR: if (iSet) { - wall[iWall].nextsector= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].nextsector=lValue; return; } Gv_SetVar(lVar2, wall[iWall].nextsector, g_i, g_p); @@ -2669,7 +2689,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_CSTAT: if (iSet) { - wall[iWall].cstat= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].cstat=lValue; return; } Gv_SetVar(lVar2, wall[iWall].cstat, g_i, g_p); @@ -2678,7 +2698,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_PICNUM: if (iSet) { - wall[iWall].picnum= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].picnum=lValue; return; } Gv_SetVar(lVar2, wall[iWall].picnum, g_i, g_p); @@ -2687,7 +2707,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_OVERPICNUM: if (iSet) { - wall[iWall].overpicnum= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].overpicnum=lValue; return; } Gv_SetVar(lVar2, wall[iWall].overpicnum, g_i, g_p); @@ -2696,7 +2716,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_SHADE: if (iSet) { - wall[iWall].shade= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].shade=lValue; return; } Gv_SetVar(lVar2, wall[iWall].shade, g_i, g_p); @@ -2705,7 +2725,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_PAL: if (iSet) { - wall[iWall].pal= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].pal=lValue; return; } Gv_SetVar(lVar2, wall[iWall].pal, g_i, g_p); @@ -2714,7 +2734,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_XREPEAT: if (iSet) { - wall[iWall].xrepeat= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].xrepeat=lValue; return; } Gv_SetVar(lVar2, wall[iWall].xrepeat, g_i, g_p); @@ -2723,7 +2743,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_YREPEAT: if (iSet) { - wall[iWall].yrepeat= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].yrepeat=lValue; return; } Gv_SetVar(lVar2, wall[iWall].yrepeat, g_i, g_p); @@ -2732,7 +2752,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_XPANNING: if (iSet) { - wall[iWall].xpanning= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].xpanning=lValue; return; } Gv_SetVar(lVar2, wall[iWall].xpanning, g_i, g_p); @@ -2741,7 +2761,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_YPANNING: if (iSet) { - wall[iWall].ypanning= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].ypanning=lValue; return; } Gv_SetVar(lVar2, wall[iWall].ypanning, g_i, g_p); @@ -2750,7 +2770,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_LOTAG: if (iSet) { - wall[iWall].lotag= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].lotag=lValue; return; } Gv_SetVar(lVar2, wall[iWall].lotag, g_i, g_p); @@ -2759,7 +2779,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_HITAG: if (iSet) { - wall[iWall].hitag= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].hitag=lValue; return; } Gv_SetVar(lVar2, wall[iWall].hitag, g_i, g_p); @@ -2768,7 +2788,7 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) case WALL_EXTRA: if (iSet) { - wall[iWall].extra= Gv_GetVar(lVar2, g_i, g_p); + wall[iWall].extra=lValue; return; } Gv_SetVar(lVar2, wall[iWall].extra, g_i, g_p); @@ -2778,8 +2798,9 @@ void X_AccessWall(int iSet, int lVar1, int lLabelID, int lVar2) } } -void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) +static inline void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) { + int lValue=0; int iSector=sprite[g_i].sectnum; if (lVar1 != g_iThisActorID) @@ -2792,12 +2813,15 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) return; } + if (iSet) + lValue=Gv_GetVar(lVar2, g_i, g_p); + switch (lLabelID) { case SECTOR_WALLPTR: if (iSet) { - sector[iSector].wallptr= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].wallptr=lValue; return; } Gv_SetVar(lVar2, sector[iSector].wallptr,g_i,g_p); @@ -2806,7 +2830,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_WALLNUM: if (iSet) { - sector[iSector].wallnum= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].wallnum=lValue; return; } Gv_SetVar(lVar2, sector[iSector].wallnum,g_i,g_p); @@ -2815,7 +2839,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_CEILINGZ: if (iSet) { - sector[iSector].ceilingz= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].ceilingz=lValue; return; } Gv_SetVar(lVar2, sector[iSector].ceilingz,g_i,g_p); @@ -2824,7 +2848,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_FLOORZ: if (iSet) { - sector[iSector].floorz= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].floorz=lValue; return; } Gv_SetVar(lVar2, sector[iSector].floorz,g_i,g_p); @@ -2833,7 +2857,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_CEILINGSTAT: if (iSet) { - sector[iSector].ceilingstat= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].ceilingstat=lValue; return; } Gv_SetVar(lVar2, sector[iSector].ceilingstat,g_i,g_p); @@ -2842,7 +2866,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_FLOORSTAT: if (iSet) { - sector[iSector].floorstat= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].floorstat=lValue; return; } Gv_SetVar(lVar2, sector[iSector].floorstat,g_i,g_p); @@ -2851,7 +2875,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_CEILINGPICNUM: if (iSet) { - sector[iSector].ceilingpicnum= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].ceilingpicnum=lValue; return; } Gv_SetVar(lVar2, sector[iSector].ceilingpicnum,g_i,g_p); @@ -2860,7 +2884,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_CEILINGSLOPE: if (iSet) { - sector[iSector].ceilingheinum= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].ceilingheinum=lValue; return; } Gv_SetVar(lVar2, sector[iSector].ceilingheinum,g_i,g_p); @@ -2869,7 +2893,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_CEILINGSHADE: if (iSet) { - sector[iSector].ceilingshade= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].ceilingshade=lValue; return; } Gv_SetVar(lVar2, sector[iSector].ceilingshade,g_i,g_p); @@ -2878,7 +2902,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_CEILINGPAL: if (iSet) { - sector[iSector].ceilingpal= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].ceilingpal=lValue; return; } Gv_SetVar(lVar2, sector[iSector].ceilingpal,g_i,g_p); @@ -2887,7 +2911,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_CEILINGXPANNING: if (iSet) { - sector[iSector].ceilingxpanning= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].ceilingxpanning=lValue; return; } Gv_SetVar(lVar2, sector[iSector].ceilingxpanning,g_i,g_p); @@ -2896,7 +2920,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_CEILINGYPANNING: if (iSet) { - sector[iSector].ceilingypanning= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].ceilingypanning=lValue; return; } Gv_SetVar(lVar2, sector[iSector].ceilingypanning,g_i,g_p); @@ -2905,7 +2929,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_FLOORPICNUM: if (iSet) { - sector[iSector].floorpicnum= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].floorpicnum=lValue; return; } Gv_SetVar(lVar2, sector[iSector].floorpicnum,g_i,g_p); @@ -2914,7 +2938,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_FLOORSLOPE: if (iSet) { - sector[iSector].floorheinum= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].floorheinum=lValue; return; } Gv_SetVar(lVar2, sector[iSector].floorheinum,g_i,g_p); @@ -2923,7 +2947,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_FLOORSHADE: if (iSet) { - sector[iSector].floorshade= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].floorshade=lValue; return; } Gv_SetVar(lVar2, sector[iSector].floorshade,g_i,g_p); @@ -2932,7 +2956,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_FLOORPAL: if (iSet) { - sector[iSector].floorpal= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].floorpal=lValue; return; } Gv_SetVar(lVar2, sector[iSector].floorpal,g_i,g_p); @@ -2941,7 +2965,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_FLOORXPANNING: if (iSet) { - sector[iSector].floorxpanning= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].floorxpanning=lValue; return; } Gv_SetVar(lVar2, sector[iSector].floorxpanning,g_i,g_p); @@ -2950,7 +2974,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_FLOORYPANNING: if (iSet) { - sector[iSector].floorypanning= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].floorypanning=lValue; return; } Gv_SetVar(lVar2, sector[iSector].floorypanning,g_i,g_p); @@ -2959,7 +2983,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_VISIBILITY: if (iSet) { - sector[iSector].visibility= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].visibility=lValue; return; } Gv_SetVar(lVar2, sector[iSector].visibility,g_i,g_p); @@ -2968,7 +2992,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_ALIGNTO: if (iSet) { - sector[iSector].filler= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].filler=lValue; return; } Gv_SetVar(lVar2, sector[iSector].filler,g_i,g_p); @@ -2977,7 +3001,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_LOTAG: if (iSet) { - sector[iSector].lotag= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].lotag=lValue; return; } Gv_SetVar(lVar2, sector[iSector].lotag,g_i,g_p); @@ -2986,7 +3010,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_HITAG: if (iSet) { - sector[iSector].hitag= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].hitag=lValue; return; } Gv_SetVar(lVar2, sector[iSector].hitag,g_i,g_p); @@ -2995,7 +3019,7 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) case SECTOR_EXTRA: if (iSet) { - sector[iSector].extra= Gv_GetVar(lVar2, g_i, g_p); + sector[iSector].extra=lValue; return; } Gv_SetVar(lVar2, sector[iSector].extra,g_i,g_p); @@ -3006,8 +3030,9 @@ void X_AccessSector(int iSet, int lVar1, int lLabelID, int lVar2) } } -void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) +static inline void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) { + int lValue=0; int iActor=g_i; if (lVar1 != g_iThisActorID) @@ -3030,12 +3055,15 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) return; } + if (iSet) + lValue=Gv_GetVar(lVar2, g_i, g_p); + switch (lLabelID) { case ACTOR_X: if (iSet) { - sprite[iActor].x= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].x=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].x,g_i,g_p); @@ -3044,7 +3072,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_Y: if (iSet) { - sprite[iActor].y= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].y=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].y,g_i,g_p); @@ -3053,7 +3081,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_Z: if (iSet) { - sprite[iActor].z= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].z=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].z,g_i,g_p); @@ -3062,7 +3090,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_CSTAT: if (iSet) { - sprite[iActor].cstat= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].cstat=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].cstat,g_i,g_p); @@ -3071,7 +3099,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_PICNUM: if (iSet) { - sprite[iActor].picnum= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].picnum=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].picnum,g_i,g_p); @@ -3080,7 +3108,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_SHADE: if (iSet) { - sprite[iActor].shade= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].shade=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].shade,g_i,g_p); @@ -3089,7 +3117,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_PAL: if (iSet) { - sprite[iActor].pal= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].pal=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].pal,g_i,g_p); @@ -3098,7 +3126,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_CLIPDIST: if (iSet) { - sprite[iActor].clipdist= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].clipdist=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].clipdist,g_i,g_p); @@ -3107,7 +3135,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_DETAIL: if (iSet) { - sprite[iActor].filler= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].filler=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].filler,g_i,g_p); @@ -3116,7 +3144,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_XREPEAT: if (iSet) { - sprite[iActor].xrepeat= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].xrepeat=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].xrepeat,g_i,g_p); @@ -3125,7 +3153,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_YREPEAT: if (iSet) { - sprite[iActor].yrepeat= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].yrepeat=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].yrepeat,g_i,g_p); @@ -3134,7 +3162,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_XOFFSET: if (iSet) { - sprite[iActor].xoffset= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].xoffset=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].xoffset,g_i,g_p); @@ -3143,7 +3171,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_YOFFSET: if (iSet) { - sprite[iActor].yoffset= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].yoffset=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].yoffset,g_i,g_p); @@ -3152,7 +3180,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_SECTNUM: if (iSet) { - changespritesect(iActor,Gv_GetVar(lVar2, g_i, g_p)); + changespritesect(iActor,lValue); return; } Gv_SetVar(lVar2, sprite[iActor].sectnum,g_i,g_p); @@ -3161,7 +3189,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_STATNUM: if (iSet) { - changespritestat(iActor,Gv_GetVar(lVar2, g_i, g_p)); + changespritestat(iActor,lValue); return; } Gv_SetVar(lVar2, sprite[iActor].statnum,g_i,g_p); @@ -3170,7 +3198,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_ANG: if (iSet) { - sprite[iActor].ang= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].ang=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].ang,g_i,g_p); @@ -3179,7 +3207,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_OWNER: if (iSet) { - sprite[iActor].owner= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].owner=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].owner,g_i,g_p); @@ -3188,7 +3216,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_XVEL: if (iSet) { - sprite[iActor].xvel= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].xvel=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].xvel,g_i,g_p); @@ -3197,7 +3225,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_YVEL: if (iSet) { - sprite[iActor].yvel= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].yvel=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].yvel,g_i,g_p); @@ -3206,7 +3234,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_ZVEL: if (iSet) { - sprite[iActor].zvel= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].zvel=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].zvel,g_i,g_p); @@ -3215,7 +3243,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_LOTAG: if (iSet) { - sprite[iActor].lotag= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].lotag=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].lotag,g_i,g_p); @@ -3224,7 +3252,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HITAG: if (iSet) { - sprite[iActor].hitag= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].hitag=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].hitag,g_i,g_p); @@ -3233,7 +3261,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_EXTRA: if (iSet) { - sprite[iActor].extra= Gv_GetVar(lVar2, g_i, g_p); + sprite[iActor].extra=lValue; return; } Gv_SetVar(lVar2, sprite[iActor].extra,g_i,g_p); @@ -3242,7 +3270,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTCGG: if (iSet) { - ActorExtra[iActor].cgg= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].cgg=lValue; return; } Gv_SetVar(lVar2, ActorExtra[iActor].cgg, g_i, g_p); @@ -3251,7 +3279,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTPICNUM : if (iSet) { - ActorExtra[iActor].picnum= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].picnum=lValue; return; } Gv_SetVar(lVar2, ActorExtra[iActor].picnum, g_i, g_p); @@ -3260,7 +3288,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTANG: if (iSet) { - ActorExtra[iActor].ang= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].ang=lValue; return; } Gv_SetVar(lVar2, ActorExtra[iActor].ang, g_i, g_p); @@ -3269,7 +3297,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTEXTRA: if (iSet) { - ActorExtra[iActor].extra= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].extra=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].extra, g_i, g_p); @@ -3278,7 +3306,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTOWNER: if (iSet) { - ActorExtra[iActor].owner= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].owner=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].owner, g_i, g_p); @@ -3287,7 +3315,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTMOVFLAG: if (iSet) { - ActorExtra[iActor].movflag= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].movflag=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].movflag, g_i, g_p); @@ -3296,7 +3324,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTTEMPANG: if (iSet) { - ActorExtra[iActor].tempang= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].tempang=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].tempang, g_i, g_p); @@ -3305,7 +3333,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTACTORSTAYPUT: if (iSet) { - ActorExtra[iActor].actorstayput= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].actorstayput=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].actorstayput, g_i, g_p); @@ -3314,7 +3342,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTDISPICNUM: if (iSet) { - ActorExtra[iActor].dispicnum= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].dispicnum=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].dispicnum, g_i, g_p); @@ -3323,7 +3351,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTTIMETOSLEEP: if (iSet) { - ActorExtra[iActor].timetosleep= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].timetosleep=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].timetosleep, g_i, g_p); @@ -3332,7 +3360,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTFLOORZ: if (iSet) { - ActorExtra[iActor].floorz= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].floorz=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].floorz, g_i, g_p); @@ -3341,7 +3369,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTCEILINGZ: if (iSet) { - ActorExtra[iActor].ceilingz= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].ceilingz=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].ceilingz, g_i, g_p); @@ -3350,7 +3378,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTLASTVX: if (iSet) { - ActorExtra[iActor].lastvx= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].lastvx=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].lastvx, g_i, g_p); @@ -3359,7 +3387,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTLASTVY: if (iSet) { - ActorExtra[iActor].lastvy= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].lastvy=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].lastvy, g_i, g_p); @@ -3368,7 +3396,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTBPOSX: if (iSet) { - ActorExtra[iActor].bposx= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].bposx=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].bposx, g_i, g_p); @@ -3377,7 +3405,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTBPOSY: if (iSet) { - ActorExtra[iActor].bposy= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].bposy=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].bposy, g_i, g_p); @@ -3386,7 +3414,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTBPOSZ: if (iSet) { - ActorExtra[iActor].bposz= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].bposz=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].bposz, g_i, g_p); @@ -3395,7 +3423,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTG_T: if (iSet) { - ActorExtra[iActor].temp_data[lParm2]= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].temp_data[lParm2]=lValue; return; } Gv_SetVar(lVar2, ActorExtra[iActor].temp_data[lParm2], g_i, g_p); @@ -3404,7 +3432,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_ANGOFF: if (iSet) { - spriteext[iActor].angoff= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].angoff=lValue; return; } Gv_SetVar(lVar2,spriteext[iActor].angoff, g_i, g_p); @@ -3413,7 +3441,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_PITCH: if (iSet) { - spriteext[iActor].pitch= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].pitch=lValue; return; } Gv_SetVar(lVar2,spriteext[iActor].pitch, g_i, g_p); @@ -3422,7 +3450,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_ROLL: if (iSet) { - spriteext[iActor].roll= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].roll=lValue; return; } Gv_SetVar(lVar2,spriteext[iActor].roll, g_i, g_p); @@ -3431,7 +3459,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_MDXOFF: if (iSet) { - spriteext[iActor].xoff= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].xoff=lValue; return; } Gv_SetVar(lVar2,spriteext[iActor].xoff, g_i, g_p); @@ -3440,7 +3468,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_MDYOFF: if (iSet) { - spriteext[iActor].yoff= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].yoff=lValue; return; } Gv_SetVar(lVar2,spriteext[iActor].yoff, g_i, g_p); @@ -3449,7 +3477,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_MDZOFF: if (iSet) { - spriteext[iActor].zoff= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].zoff=lValue; return; } Gv_SetVar(lVar2,spriteext[iActor].zoff, g_i, g_p); @@ -3458,7 +3486,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_MDFLAGS: if (iSet) { - spriteext[iActor].flags= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].flags=lValue; return; } Gv_SetVar(lVar2,spriteext[iActor].flags, g_i, g_p); @@ -3467,7 +3495,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_XPANNING: if (iSet) { - spriteext[iActor].xpanning= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].xpanning=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].xpanning,g_i,g_p); @@ -3476,7 +3504,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_YPANNING: if (iSet) { - spriteext[iActor].ypanning= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].ypanning=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].ypanning,g_i,g_p); @@ -3485,7 +3513,7 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) case ACTOR_HTFLAGS: if (iSet) { - ActorExtra[iActor].flags= Gv_GetVar(lVar2, g_i, g_p); + ActorExtra[iActor].flags=lValue; return; } Gv_SetVar(lVar2,ActorExtra[iActor].flags, g_i, g_p); @@ -3496,8 +3524,9 @@ void X_AccessSprite(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) } } -void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) +static inline void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) { + int lValue=0; int iActor=g_i; if (lVar1 != g_iThisActorID) @@ -3510,6 +3539,9 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) return; } + if (iSet) + lValue=Gv_GetVar(lVar2, g_i, g_p); + if ((!spriteext[iActor].tspr) && g_scriptSanityChecks) { OSD_Printf(CON_ERROR "Internal bug, tsprite is unavailable\n",g_errorLineNum,keyw[g_tw]); @@ -3521,7 +3553,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_X: if (iSet) { - spriteext[iActor].tspr->x= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->x=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->x,g_i,g_p); @@ -3530,7 +3562,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_Y: if (iSet) { - spriteext[iActor].tspr->y= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->y=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->y,g_i,g_p); @@ -3539,7 +3571,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_Z: if (iSet) { - spriteext[iActor].tspr->z= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->z=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->z,g_i,g_p); @@ -3548,7 +3580,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_CSTAT: if (iSet) { - spriteext[iActor].tspr->cstat= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->cstat=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->cstat,g_i,g_p); @@ -3557,7 +3589,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_PICNUM: if (iSet) { - spriteext[iActor].tspr->picnum= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->picnum=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->picnum,g_i,g_p); @@ -3566,7 +3598,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_SHADE: if (iSet) { - spriteext[iActor].tspr->shade= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->shade=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->shade,g_i,g_p); @@ -3575,7 +3607,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_PAL: if (iSet) { - spriteext[iActor].tspr->pal= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->pal=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->pal,g_i,g_p); @@ -3584,7 +3616,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_CLIPDIST: if (iSet) { - spriteext[iActor].tspr->clipdist= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->clipdist=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->clipdist,g_i,g_p); @@ -3593,7 +3625,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_DETAIL: if (iSet) { - spriteext[iActor].tspr->filler= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->filler=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->filler,g_i,g_p); @@ -3602,7 +3634,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_XREPEAT: if (iSet) { - spriteext[iActor].tspr->xrepeat= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->xrepeat=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->xrepeat,g_i,g_p); @@ -3611,7 +3643,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_YREPEAT: if (iSet) { - spriteext[iActor].tspr->yrepeat= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->yrepeat=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->yrepeat,g_i,g_p); @@ -3620,7 +3652,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_XOFFSET: if (iSet) { - spriteext[iActor].tspr->xoffset= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->xoffset=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->xoffset,g_i,g_p); @@ -3629,7 +3661,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_YOFFSET: if (iSet) { - spriteext[iActor].tspr->yoffset= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->yoffset=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->yoffset,g_i,g_p); @@ -3638,7 +3670,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_SECTNUM: if (iSet) { - spriteext[iActor].tspr->sectnum= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->sectnum=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->sectnum,g_i,g_p); @@ -3647,7 +3679,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_STATNUM: if (iSet) { - spriteext[iActor].tspr->statnum= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->statnum=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->statnum,g_i,g_p); @@ -3656,7 +3688,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_ANG: if (iSet) { - spriteext[iActor].tspr->ang= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->ang=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->ang,g_i,g_p); @@ -3665,7 +3697,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_OWNER: if (iSet) { - spriteext[iActor].tspr->owner= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->owner=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->owner,g_i,g_p); @@ -3675,7 +3707,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_XVEL: if (iSet) { - spriteext[iActor].tspr->xvel= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->xvel=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->xvel,g_i,g_p); @@ -3684,7 +3716,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_YVEL: if (iSet) { - spriteext[iActor].tspr->yvel= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->yvel=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->yvel,g_i,g_p); @@ -3693,7 +3725,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_ZVEL: if (iSet) { - spriteext[iActor].tspr->zvel= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->zvel=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->zvel,g_i,g_p); @@ -3702,7 +3734,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_LOTAG: if (iSet) { - spriteext[iActor].tspr->lotag= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->lotag=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->lotag,g_i,g_p); @@ -3711,7 +3743,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_HITAG: if (iSet) { - spriteext[iActor].tspr->hitag= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->hitag=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->hitag,g_i,g_p); @@ -3720,7 +3752,7 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) case ACTOR_EXTRA: if (iSet) { - spriteext[iActor].tspr->extra= Gv_GetVar(lVar2, g_i, g_p); + spriteext[iActor].tspr->extra=lValue; return; } Gv_SetVar(lVar2, spriteext[iActor].tspr->extra,g_i,g_p); @@ -3732,8 +3764,10 @@ void X_AccessTsprite(int iSet, int lVar1, int lLabelID, int lVar2) } } -void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) +static inline void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) { + int lValue=0; + if ((lVar1 < 0 || lVar1 >= MAXTILES) && g_scriptSanityChecks) { OSD_Printf(CON_ERROR "invalid tile (%d)\n",g_errorLineNum,keyw[g_tw],lVar1); @@ -3741,12 +3775,15 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) return; } + if (iSet) + lValue=Gv_GetVar(lVar2, g_i, g_p); + switch (lLabelID) { case PROJ_WORKSLIKE: if (iSet) { - ProjectileData[lVar1].workslike= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].workslike=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].workslike, g_i, g_p); @@ -3755,7 +3792,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_SPAWNS: if (iSet) { - ProjectileData[lVar1].spawns= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].spawns=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].spawns, g_i, g_p); @@ -3764,7 +3801,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_SXREPEAT: if (iSet) { - ProjectileData[lVar1].sxrepeat= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].sxrepeat=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].sxrepeat, g_i, g_p); @@ -3773,7 +3810,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_SYREPEAT: if (iSet) { - ProjectileData[lVar1].syrepeat= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].syrepeat=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].syrepeat, g_i, g_p); @@ -3782,7 +3819,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_SOUND: if (iSet) { - ProjectileData[lVar1].sound= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].sound=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].sound, g_i, g_p); @@ -3791,7 +3828,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_ISOUND: if (iSet) { - ProjectileData[lVar1].isound= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].isound=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].isound, g_i, g_p); @@ -3800,7 +3837,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_VEL: if (iSet) { - ProjectileData[lVar1].vel= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].vel=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].vel, g_i, g_p); @@ -3809,7 +3846,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_EXTRA: if (iSet) { - ProjectileData[lVar1].extra= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].extra=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].extra, g_i, g_p); @@ -3818,7 +3855,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_DECAL: if (iSet) { - ProjectileData[lVar1].decal= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].decal=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].decal, g_i, g_p); @@ -3827,7 +3864,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_TRAIL: if (iSet) { - ProjectileData[lVar1].trail= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].trail=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].trail, g_i, g_p); @@ -3836,7 +3873,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_TXREPEAT: if (iSet) { - ProjectileData[lVar1].txrepeat= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].txrepeat=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].txrepeat, g_i, g_p); @@ -3845,7 +3882,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_TYREPEAT: if (iSet) { - ProjectileData[lVar1].tyrepeat= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].tyrepeat=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].tyrepeat, g_i, g_p); @@ -3854,7 +3891,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_TOFFSET: if (iSet) { - ProjectileData[lVar1].toffset= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].toffset=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].toffset, g_i, g_p); @@ -3863,7 +3900,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_TNUM: if (iSet) { - ProjectileData[lVar1].tnum= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].tnum=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].tnum, g_i, g_p); @@ -3872,7 +3909,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_DROP: if (iSet) { - ProjectileData[lVar1].drop= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].drop=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].drop, g_i, g_p); @@ -3881,7 +3918,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_CSTAT: if (iSet) { - ProjectileData[lVar1].cstat= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].cstat=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].cstat, g_i, g_p); @@ -3890,7 +3927,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_CLIPDIST: if (iSet) { - ProjectileData[lVar1].clipdist= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].clipdist=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].clipdist, g_i, g_p); @@ -3899,7 +3936,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_SHADE: if (iSet) { - ProjectileData[lVar1].shade= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].shade=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].shade, g_i, g_p); @@ -3908,7 +3945,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_XREPEAT: if (iSet) { - ProjectileData[lVar1].xrepeat= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].xrepeat=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].xrepeat, g_i, g_p); @@ -3917,7 +3954,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_YREPEAT: if (iSet) { - ProjectileData[lVar1].yrepeat= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].yrepeat=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].yrepeat, g_i, g_p); @@ -3926,7 +3963,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_PAL: if (iSet) { - ProjectileData[lVar1].pal= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].pal=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].pal, g_i, g_p); @@ -3935,7 +3972,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_EXTRA_RAND: if (iSet) { - ProjectileData[lVar1].extra_rand= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].extra_rand=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].extra_rand, g_i, g_p); @@ -3944,7 +3981,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_HITRADIUS: if (iSet) { - ProjectileData[lVar1].hitradius= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].hitradius=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].hitradius, g_i, g_p); @@ -3953,7 +3990,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_VEL_MULT: if (iSet) { - ProjectileData[lVar1].velmult= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].velmult=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].velmult, g_i, g_p); @@ -3962,7 +3999,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_OFFSET: if (iSet) { - ProjectileData[lVar1].offset= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].offset=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].offset, g_i, g_p); @@ -3971,7 +4008,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_BOUNCES: if (iSet) { - ProjectileData[lVar1].bounces= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].bounces=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].bounces, g_i, g_p); @@ -3980,7 +4017,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_BSOUND: if (iSet) { - ProjectileData[lVar1].bsound= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].bsound=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].bsound, g_i, g_p); @@ -3989,7 +4026,7 @@ void X_AccessProjectile(int iSet, int lVar1, int lLabelID, int lVar2) case PROJ_RANGE: if (iSet) { - ProjectileData[lVar1].range= Gv_GetVar(lVar2, g_i, g_p); + ProjectileData[lVar1].range=lValue; return; } Gv_SetVar(lVar2, ProjectileData[lVar1].range, g_i, g_p);