diff --git a/polymer/build/src/config.c b/polymer/build/src/config.c index a4acc40ee..125b05267 100644 --- a/polymer/build/src/config.c +++ b/polymer/build/src/config.c @@ -59,6 +59,8 @@ extern short brightness; extern int fullscreen; extern char option[8]; extern char keys[NUMBUILDKEYS]; +extern unsigned char remap[256]; +extern int remapinit; extern double msens; extern int editorgridextent; @@ -103,7 +105,7 @@ extern int editorgridextent; int loadsetup(const char *fn) { BFILE *fp; -#define VL 32 +#define VL 256 char val[VL]; int i; @@ -196,6 +198,22 @@ int loadsetup(const char *fn) if (readconfig(fp, "keyconsole", val, VL) > 0) { keys[19] = Bstrtol(val, NULL, 16); OSD_CaptureKey(keys[19]); } if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL); + + for (i=0;i<256;i++)remap[i]=i; + remapinit=1; + if (readconfig(fp, "remap", val, VL) > 0) + { + char *p=val;int v1,v2; + while (*p) + { + if (!sscanf(p,"%x",&v1))break; + if ((p=strchr(p,'-'))==0)break;p++; + if (!sscanf(p,"%x",&v2))break; + remap[v1]=v2; + initprintf("Remap %X key to %X\n",v1,v2); + if ((p=strchr(p,','))==0)break;p++; + } + } Bfclose(fp); return 0; @@ -204,6 +222,7 @@ int loadsetup(const char *fn) int writesetup(const char *fn) { BFILE *fp; + int i,first=1; fp = Bfopen(fn,"wt"); if (!fp) return -1; @@ -325,7 +344,7 @@ int writesetup(const char *fn) #endif // "; Console key scancode, in hex\n" "keyconsole = %X\n" - "\n", + "remap = ", forcesetup, fullscreen, xdim2d, ydim2d, xdimgame, ydimgame, bppgame, editorgridextent, @@ -349,6 +368,13 @@ int writesetup(const char *fn) keys[19] ); + + for (i=0;i<256;i++)if (remap[i]!=i) + { + Bfprintf(fp,first?"%02X-%02X":",%02X-%02X",i,remap[i]); + first=0; + } + Bfprintf(fp,"\n"); Bfclose(fp); return 0; diff --git a/polymer/build/src/sdlayer.c b/polymer/build/src/sdlayer.c index 4f6c91307..1e1b2eee8 100644 --- a/polymer/build/src/sdlayer.c +++ b/polymer/build/src/sdlayer.c @@ -69,6 +69,8 @@ static char nogl=0; char inputdevices=0; char keystatus[256], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend; unsigned char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend; +unsigned char remap[256]; +int remapinit=0; static unsigned char keynames[256][24]; int mousex=0,mousey=0,mouseb=0; int *joyaxis = NULL, joyb=0, *joyhat = NULL; @@ -335,6 +337,7 @@ int initinput(void) // force OS X to operate in >1 button mouse mode so that LMB isn't adulterated if (!getenv("SDL_HAS3BUTTONMOUSE")) putenv("SDL_HAS3BUTTONMOUSE=1"); #endif + if (!remapinit)for (i=0;i<256;i++)remap[i]=i;remapinit=1; if (SDL_EnableKeyRepeat(250, 30)) initprintf("Error enabling keyboard repeat.\n"); inputdevices = 1|2; // keyboard (1) and mouse (2) @@ -1346,9 +1349,9 @@ int handleevents(void) SDL_Event ev; #define SetKey(key,state) { \ - keystatus[key] = state; \ + keystatus[remap[key]] = state; \ if (state) { \ - keyfifo[keyfifoend] = key; \ + keyfifo[keyfifoend] = remap[key]; \ keyfifo[(keyfifoend+1)&(KEYFIFOSIZ-1)] = state; \ keyfifoend = ((keyfifoend+2)&(KEYFIFOSIZ-1)); \ } \ diff --git a/polymer/build/src/winlayer.c b/polymer/build/src/winlayer.c index ce3fc6aae..738a4095f 100644 --- a/polymer/build/src/winlayer.c +++ b/polymer/build/src/winlayer.c @@ -126,6 +126,8 @@ static char taskswitching=1; char keystatus[256], keyfifo[KEYFIFOSIZ], keyfifoplc, keyfifoend; unsigned char keyasciififo[KEYFIFOSIZ], keyasciififoplc, keyasciififoend; +unsigned char remap[256]; +int remapinit=0; static unsigned char keynames[256][24]; static unsigned int lastKeyDown = 0; static unsigned int lastKeyTime = 0; @@ -725,9 +727,9 @@ static struct _joydevicedefn *thisjoydef = NULL, joyfeatures[] = // I don't see any pressing need to store the key-up events yet #define SetKey(key,state) { \ - keystatus[key] = state; \ + keystatus[remap[key]] = state; \ if (state) { \ - keyfifo[keyfifoend] = key; \ + keyfifo[keyfifoend] = remap[key]; \ keyfifo[(keyfifoend+1)&(KEYFIFOSIZ-1)] = state; \ keyfifoend = ((keyfifoend+2)&(KEYFIFOSIZ-1)); \ } \ @@ -739,8 +741,10 @@ static struct _joydevicedefn *thisjoydef = NULL, joyfeatures[] = // int initinput(void) { + int i; moustat=0; memset(keystatus, 0, sizeof(keystatus)); + if (!remapinit)for (i=0;i<256;i++)remap[i]=i;remapinit=1; keyfifoplc = keyfifoend = 0; keyasciififoplc = keyasciififoend = 0; diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index d8b019d82..9c4ee5a49 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -66,7 +66,7 @@ extern int g_ScriptVersion, g_Shareware, g_GameType; #define BYTEVERSION_13 27 #define BYTEVERSION_14 116 #define BYTEVERSION_15 117 -#define BYTEVERSION_JF 177 // increase by 3, because atomic GRP adds 1, and Shareware adds 2 +#define BYTEVERSION_JF 180 // increase by 3, because atomic GRP adds 1, and Shareware adds 2 #define BYTEVERSION (BYTEVERSION_JF+(PLUTOPAK?1:(VOLUMEONE<<1))) // JBF 20040116: different data files give different versions @@ -293,9 +293,9 @@ enum USRHOOKS_Errors { }; typedef struct { - signed char avel, horz; - short fvel, svel; unsigned int bits, extbits; + short fvel, svel; + signed char avel, horz; } input; #define sync dsync // JBF 20040604: sync is a function on some platforms @@ -304,26 +304,23 @@ extern input recsync[RECSYNCBUFSIZ]; extern int movefifosendplc; typedef struct { - short i; int voice; + int i; } SOUNDOWNER; typedef struct { - char *ptr; - volatile char lock; - int length, num; - SOUNDOWNER SoundOwner[4]; - char *filename; + int length, num, soundsiz; + char *filename, *ptr; short ps,pe,vo; + volatile char lock; char pr,m; - int soundsiz; + SOUNDOWNER SoundOwner[4]; } sound_t; extern sound_t g_sounds[MAXSOUNDS]; typedef struct { -short wallnum; -int tag; + int wallnum, tag; } animwalltype; extern animwalltype animwall[MAXANIMWALLS]; @@ -344,6 +341,14 @@ struct savehead { }; typedef struct { + int UseJoystick; + int UseMouse; + int RunMode; + int AutoAim; + int ShowOpponentWeapons; + int MouseFilter,MouseBias; + int SmoothInput; + // // Sound variables // @@ -363,28 +368,6 @@ typedef struct { int ReverseStereo; - int UseJoystick; - int UseMouse; - int RunMode; - int AutoAim; - int ShowOpponentWeapons; - int MouseFilter,MouseBias; - int SmoothInput; - - // JBF 20031211: Store the input settings because - // (currently) jmact can't regurgitate them - byte KeyboardKeys[NUMGAMEFUNCTIONS][2]; - int MouseFunctions[MAXMOUSEBUTTONS][2]; - int MouseDigitalFunctions[MAXMOUSEAXES][2]; - int MouseAnalogueAxes[MAXMOUSEAXES]; - int MouseAnalogueScale[MAXMOUSEAXES]; - int JoystickFunctions[MAXJOYBUTTONS][2]; - int JoystickDigitalFunctions[MAXJOYAXES][2]; - int JoystickAnalogueAxes[MAXJOYAXES]; - int JoystickAnalogueScale[MAXJOYAXES]; - int JoystickAnalogueDead[MAXJOYAXES]; - int JoystickAnalogueSaturate[MAXJOYAXES]; - // // Screen variables // @@ -403,23 +386,23 @@ typedef struct { int CheckForUpdates; int LastUpdateCheck; int useprecache; + + // JBF 20031211: Store the input settings because + // (currently) jmact can't regurgitate them + int MouseFunctions[MAXMOUSEBUTTONS][2]; + int MouseDigitalFunctions[MAXMOUSEAXES][2]; + int MouseAnalogueAxes[MAXMOUSEAXES]; + int MouseAnalogueScale[MAXMOUSEAXES]; + int JoystickFunctions[MAXJOYBUTTONS][2]; + int JoystickDigitalFunctions[MAXJOYAXES][2]; + int JoystickAnalogueAxes[MAXJOYAXES]; + int JoystickAnalogueScale[MAXJOYAXES]; + int JoystickAnalogueDead[MAXJOYAXES]; + int JoystickAnalogueSaturate[MAXJOYAXES]; + byte KeyboardKeys[NUMGAMEFUNCTIONS][2]; } config_t; typedef struct { - char god,warp_on,cashman,eog,showallmap; - char show_help,scrollmode,clipping; - char ridecule[10][40]; - char savegame[10][22]; - char pwlockout[128],rtsname[128]; - char overhead_on,last_overhead,showweapons; - - short pause_on,from_bonus; - short camerasprite,last_camsprite; - short last_level,secretlevel; - - short cameraang, camerasect, camerahoriz; - int camerax,cameray,cameraz; - int const_visibility,uw_framerate; int camera_time,folfvel,folavel,folx,foly,fola; int reccnt; @@ -437,6 +420,21 @@ typedef struct { int m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail; int m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode; int player_skill,level_number,volume_number,m_marker,marker,mouseflip; + + int camerax,cameray,cameraz; + + short cameraang, camerasect, camerahoriz; + short pause_on,from_bonus; + short camerasprite,last_camsprite; + short last_level,secretlevel; + + char god,warp_on,cashman,eog,showallmap; + char show_help,scrollmode,clipping; + char ridecule[10][40]; + char savegame[10][22]; + char pwlockout[128],rtsname[128]; + char overhead_on,last_overhead,showweapons; + config_t config; } user_defs; @@ -450,7 +448,7 @@ extern char numplayersprites; extern int fricxv,fricyv; typedef struct { - int zoom,exitx,exity,loogiex[64],loogiey[64],numloogs,loogcnt; + int zoom,exitx,exity; int posx, posy, posz, horiz, ohoriz, ohorizoff, invdisptime; int bobposx,bobposy,oposx,oposy,oposz,pyoff,opyoff; int posxv,posyv,poszv,last_pissed_time,truefz,truecz; @@ -458,7 +456,19 @@ typedef struct { int bobcounter,weapon_sway; int pals_time,randomflamex,crack_time; - char aim_mode,auto_aim,weaponswitch; + unsigned int interface_toggle_flag; + + int max_secret_rooms,secret_rooms,max_actors_killed,actors_killed; + int runspeed, movement_lock, team; + int max_player_health, max_shield_amount, max_ammo_amount[MAX_WEAPONS]; + + int scream_voice; + + int loogiex[64],loogiey[64],numloogs,loogcnt; + + char *palette; + + short sbs, sound_pitch; short ang,oang,angvel,cursectnum,look_ang,last_extra,subweapon; short ammo_amount[MAX_WEAPONS],wackedbyactor,frag,fraggedself; @@ -475,34 +485,29 @@ typedef struct { short heat_amount,actorsqu,timebeforeexit,customexitsound; short weaprecs[16],weapreccnt; - unsigned int interface_toggle_flag; + short orotscrnang,rotscrnang,dead_flag,show_empty_weapon; // JBF 20031220: added orotscrnang short scuba_amount,jetpack_amount,steroids_amount,shield_amount; short holoduke_on,pycount,weapon_pos,frag_ps; short transporter_hold,last_full_weapon,footprintshade,boot_amount; - int scream_voice; + char aim_mode,auto_aim,weaponswitch; char gm,on_warping_sector,footprintcount; char hbomb_on,jumping_toggle,rapid_fire_hold,on_ground; - char name[32],inven_icon,buttonpalette; + char inven_icon,buttonpalette; char jetpack_on,spritebridge,lastrandomspot; char scuba_on,footprintpal,heat_on; char holster_weapon,falling_counter; - char gotweapon[MAX_WEAPONS],refresh_inventory,*palette; + char gotweapon[MAX_WEAPONS],refresh_inventory; char toggle_key_flag,knuckle_incs; // ,select_dir; char walking_snd_toggle, palookup, hard_landing; char /*fire_flag,*/pals[3]; - char return_to_center, reloading; - - int max_secret_rooms,secret_rooms,max_actors_killed,actors_killed; - int runspeed, movement_lock, team; - int max_player_health, max_shield_amount, max_ammo_amount[MAX_WEAPONS]; - short sbs, sound_pitch; + char return_to_center, reloading, name[32]; } player_struct; extern char tempbuf[2048], packbuf[576]; @@ -559,13 +564,13 @@ spriteinterpolate sprpos[MAXSPRITES]; typedef struct { - char cgg; + int floorz,ceilingz,lastvx,lastvy,bposx,bposy,bposz; + int flags; + int temp_data[10]; short picnum,ang,extra,owner,movflag; short tempang,actorstayput,dispicnum; short timetosleep; - int floorz,ceilingz,lastvx,lastvy,bposx,bposy,bposz; - int temp_data[10]; - int flags; + char cgg; proj_struct projectile; } actordata_t; @@ -661,12 +666,12 @@ extern short weaponsandammosprites[15]; //DUKE3D.H: typedef struct { - short frag[MAXPLAYERS], got_access, last_extra, shield_amount, curr_weapon; - short ammo_amount[MAX_WEAPONS], holoduke_on; - char gotweapon[MAX_WEAPONS], inven_icon, jetpack_on, heat_on; + short got_access, last_extra, shield_amount, curr_weapon, holoduke_on; short firstaid_amount, steroids_amount, holoduke_amount, jetpack_amount; short heat_amount, scuba_amount, boot_amount; short last_weapon, weapon_pos, kickback_pic; + short ammo_amount[MAX_WEAPONS], frag[MAXPLAYERS]; + char inven_icon, jetpack_on, heat_on, gotweapon[MAX_WEAPONS]; } STATUSBARTYPE; extern STATUSBARTYPE sbar; @@ -811,11 +816,10 @@ enum gamevarflags { typedef struct { int lValue; - char *szLabel; - unsigned int dwFlags; - - int *plValues; // array of values when 'per-player', or 'per-actor' int lDefault; + int *plValues; // array of values when 'per-player', or 'per-actor' + unsigned int dwFlags; + char *szLabel; char bReset; } gamevar_t; @@ -957,8 +961,8 @@ extern int redefined_quote_count; extern char setupfilename[BMAX_PATH]; typedef struct { - char *name, *filename, *musicfn; int partime, designertime; + char *name, *filename, *musicfn; } map_t; extern map_t map[MAXVOLUMES*MAXLEVELS]; @@ -967,22 +971,11 @@ typedef struct { player_struct *ps; input *sync; - int movefifoend; - int syncvalhead; - int myminlag; + int movefifoend, syncvalhead, myminlag; + int pcolor, pteam, frags[MAXPLAYERS], wchoice[MAX_WEAPONS]; - int frags[MAXPLAYERS]; - int pcolor; - int pteam; - int wchoice[MAX_WEAPONS]; - - char syncval[MOVEFIFOSIZ]; - char user_name[32]; - char playerreadyflag; - char playerquitflag; - - char vote; - char gotvote; + char vote, gotvote, playerreadyflag, playerquitflag; + char user_name[32], syncval[MOVEFIFOSIZ]; } playerdata_t; extern input inputfifo[MOVEFIFOSIZ][MAXPLAYERS]; @@ -1002,8 +995,8 @@ typedef struct { extern keydef keynames[]; typedef struct binding { - char name[MAXSCRIPTFILENAMELENGTH]; char *key; + char name[MAXSCRIPTFILENAMELENGTH]; } keybind; extern keybind boundkeys[MAXBOUNDKEYS]; diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 0ceea1301..dafdda9ba 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -444,7 +444,7 @@ static const char *keyw[] = "" }; -LABELS sectorlabels[]= +static const memberlabel_t sectorlabels[]= { { "wallptr", SECTOR_WALLPTR, 0, 0 }, { "wallnum", SECTOR_WALLNUM, 0, 0 }, @@ -472,7 +472,7 @@ LABELS sectorlabels[]= { "", -1, 0, 0 } // END OF LIST }; -LABELS walllabels[]= +static const memberlabel_t walllabels[]= { { "x", WALL_X, 0, 0 }, { "y", WALL_Y, 0, 0 }, @@ -494,7 +494,7 @@ LABELS walllabels[]= { "", -1, 0, 0 } // END OF LIST }; -LABELS actorlabels[]= +const memberlabel_t actorlabels[]= { { "x", ACTOR_X, 0, 0 }, { "y", ACTOR_Y, 0, 0 }, @@ -554,7 +554,7 @@ LABELS actorlabels[]= { "", -1, 0, 0 } // END OF LIST }; -LABELS playerlabels[]= +const memberlabel_t playerlabels[]= { { "zoom", PLAYER_ZOOM, 0, 0 }, { "exitx", PLAYER_EXITX, 0, 0 }, @@ -704,7 +704,7 @@ LABELS playerlabels[]= { "", -1, 0, 0 } // END OF LIST }; -LABELS projectilelabels[]= +static const memberlabel_t projectilelabels[]= { { "workslike", PROJ_WORKSLIKE, 0, 0 }, { "spawns", PROJ_SPAWNS, 0, 0 }, @@ -737,7 +737,7 @@ LABELS projectilelabels[]= { "", -1, 0, 0 } // END OF LIST }; -LABELS userdefslabels[]= +static const memberlabel_t userdefslabels[]= { // { "", 1, 0, 0 }, { "god", USERDEFS_GOD, 0, 0 }, @@ -834,7 +834,7 @@ LABELS userdefslabels[]= { "", -1, 0, 0 } // END OF LIST }; -LABELS inputlabels[]= +static const memberlabel_t inputlabels[]= { { "avel", INPUT_AVEL, 0, 0 }, { "horz", INPUT_HORZ, 0, 0 }, @@ -1220,7 +1220,7 @@ static inline int isaltok(char c) return (isalnum(c) || c == '{' || c == '}' || c == '/' || c == '*' || c == '-' || c == '_' || c == '.'); } -static int getlabelid(LABELS *pLabel, const char *psz) +static int getlabelid(const memberlabel_t *pLabel, const char *psz) { // find the label psz in the table pLabel. // returns the ID for the label, or -1 @@ -1239,7 +1239,7 @@ static int getlabelid(LABELS *pLabel, const char *psz) return l; } -static int getlabeloffset(LABELS *pLabel, const char *psz) +static int getlabeloffset(const memberlabel_t *pLabel, const char *psz) { // find the label psz in the table pLabel. // returns the offset in the array for the label, or -1 @@ -5007,7 +5007,7 @@ void loadefs(const char *filenam) if (fta_quotes[i] == NULL) fta_quotes[i] = Bcalloc(MAXQUOTELEN,sizeof(char)); { - char *ppdeathstrings[] = + const char *ppdeathstrings[] = { "^2%s ^2WAS KICKED TO THE CURB BY %s", "^2%s ^2WAS PICKED OFF BY %s", @@ -5043,7 +5043,7 @@ void loadefs(const char *filenam) "^2%s ^2WANTS TO KNOW WHY %s ^2IS EVEN PLAYING COOP", }; - char *podeathstrings[] = + const char *podeathstrings[] = { "^2%s ^2KILLED HIMSELF. WHAT A TOOL!", "^2%s ^2TRIED TO LEAVE", diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 40e49183e..187a51751 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -56,21 +56,21 @@ extern char cheatquotes[][MAXCHEATLEN]; extern char compilefile[BMAX_PATH]; extern int total_lines,line_number; extern int error,warning; -typedef struct _labels +typedef struct { char *name; int lId; int flags; int maxParm2; -} LABELS; +} memberlabel_t; -extern LABELS sectorlabels[]; -extern LABELS walllabels[]; -extern LABELS actorlabels[]; -extern LABELS playerlabels[]; -extern LABELS projectilelabels[]; -extern LABELS userdeflabels[]; -extern LABELS inputlabels[]; +/* extern memberlabel_t sectorlabels[]; +extern memberlabel_t walllabels[]; */ +extern const memberlabel_t actorlabels[]; +extern const memberlabel_t playerlabels[]; +/* extern memberlabel_t projectilelabels[]; +extern memberlabel_t userdeflabels[]; +extern memberlabel_t inputlabels[]; */ enum errors { diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 589a66ec4..22a3387b4 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -41,8 +41,9 @@ static void DoUserDef(int iSet, int lLabelID, int lVar2) if (g_p != myconnectindex) { - if (lVar2 == MAXGAMEVARS) - insptr++; +// if (lVar2 == MAXGAMEVARS) +// insptr++; + insptr += (lVar2 == MAXGAMEVARS); return; } @@ -52,654 +53,817 @@ static void DoUserDef(int iSet, int lLabelID, int lVar2) { case USERDEFS_GOD: if (iSet) + { ud.god = lValue; - else - SetGameVarID(lVar2, ud.god, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.god, g_i, g_p); + return; case USERDEFS_WARP_ON: if (iSet) + { ud.warp_on = lValue; - else - SetGameVarID(lVar2, ud.warp_on, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.warp_on, g_i, g_p); + return; case USERDEFS_CASHMAN: if (iSet) + { ud.cashman = lValue; - else - SetGameVarID(lVar2, ud.cashman, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.cashman, g_i, g_p); + return; case USERDEFS_EOG: if (iSet) + { ud.eog = lValue; - else - SetGameVarID(lVar2, ud.eog, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.eog, g_i, g_p); + return; case USERDEFS_SHOWALLMAP: if (iSet) + { ud.showallmap = lValue; - else - SetGameVarID(lVar2, ud.showallmap, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.showallmap, g_i, g_p); + return; case USERDEFS_SHOW_HELP: if (iSet) + { ud.show_help = lValue; - else - SetGameVarID(lVar2, ud.show_help, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.show_help, g_i, g_p); + return; case USERDEFS_SCROLLMODE: if (iSet) + { ud.scrollmode = lValue; - else - SetGameVarID(lVar2, ud.scrollmode, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.scrollmode, g_i, g_p); + return; case USERDEFS_CLIPPING: if (iSet) + { ud.clipping = lValue; - else - SetGameVarID(lVar2, ud.clipping, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.clipping, g_i, g_p); + return; // case USERDEFS_USER_NAME: // if(iSet) // { // ud.user_name[MAXPLAYERS][32] = lValue; // } - // else + // return; } // { // SetGameVarID(lVar2, ud.user_name[MAXPLAYERS][32], g_i, g_p); // } - // break; + // return; // case USERDEFS_RIDECULE: // if(iSet) // { // ud.ridecule = lValue; // } - // else + // return; } // { // SetGameVarID(lVar2, ud.ridecule, g_i, g_p); // } - // break; + // return; // case USERDEFS_SAVEGAME: // if(iSet) // { // ud.savegame = lValue; // } - // else + // return; } // { // SetGameVarID(lVar2, ud.savegame, g_i, g_p); // } - // break; + // return; // case USERDEFS_PWLOCKOUT: // if(iSet) // { // ud.pwlockout = lValue; // } - // else + // return; } // { // SetGameVarID(lVar2, ud.pwlockout, g_i, g_p); // } - // break; + // return; // case USERDEFS_RTSNAME: // if(iSet) // { // ud.rtsname = lValue; // } - // else + // return; } // { // SetGameVarID(lVar2, ud.rtsname, g_i, g_p); // } - // break; + // return; case USERDEFS_OVERHEAD_ON: if (iSet) + { ud.overhead_on = lValue; - else - SetGameVarID(lVar2, ud.overhead_on, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.overhead_on, g_i, g_p); + return; case USERDEFS_LAST_OVERHEAD: if (iSet) + { ud.last_overhead = lValue; - else - SetGameVarID(lVar2, ud.last_overhead, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.last_overhead, g_i, g_p); + return; case USERDEFS_SHOWWEAPONS: if (iSet) + { ud.showweapons = lValue; - else - SetGameVarID(lVar2, ud.showweapons, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.showweapons, g_i, g_p); + return; case USERDEFS_PAUSE_ON: if (iSet) + { ud.pause_on = lValue; - else - SetGameVarID(lVar2, ud.pause_on, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.pause_on, g_i, g_p); + return; case USERDEFS_FROM_BONUS: if (iSet) + { ud.from_bonus = lValue; - else - SetGameVarID(lVar2, ud.from_bonus, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.from_bonus, g_i, g_p); + return; case USERDEFS_CAMERASPRITE: if (iSet) + { ud.camerasprite = lValue; - else - SetGameVarID(lVar2, ud.camerasprite, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.camerasprite, g_i, g_p); + return; case USERDEFS_LAST_CAMSPRITE: if (iSet) + { ud.last_camsprite = lValue; - else - SetGameVarID(lVar2, ud.last_camsprite, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.last_camsprite, g_i, g_p); + return; case USERDEFS_LAST_LEVEL: if (iSet) + { ud.last_level = lValue; - else - SetGameVarID(lVar2, ud.last_level, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.last_level, g_i, g_p); + return; case USERDEFS_SECRETLEVEL: if (iSet) + { ud.secretlevel = lValue; - else - SetGameVarID(lVar2, ud.secretlevel, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.secretlevel, g_i, g_p); + return; case USERDEFS_CONST_VISIBILITY: if (iSet) + { ud.const_visibility = lValue; - else - SetGameVarID(lVar2, ud.const_visibility, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.const_visibility, g_i, g_p); + return; case USERDEFS_UW_FRAMERATE: if (iSet) + { ud.uw_framerate = lValue; - else - SetGameVarID(lVar2, ud.uw_framerate, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.uw_framerate, g_i, g_p); + return; case USERDEFS_CAMERA_TIME: if (iSet) + { ud.camera_time = lValue; - else - SetGameVarID(lVar2, ud.camera_time, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.camera_time, g_i, g_p); + return; case USERDEFS_FOLFVEL: if (iSet) + { ud.folfvel = lValue; - else - SetGameVarID(lVar2, ud.folfvel, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.folfvel, g_i, g_p); + return; case USERDEFS_FOLAVEL: if (iSet) + { ud.folavel = lValue; - else - SetGameVarID(lVar2, ud.folavel, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.folavel, g_i, g_p); + return; case USERDEFS_FOLX: if (iSet) + { ud.folx = lValue; - else - SetGameVarID(lVar2, ud.folx, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.folx, g_i, g_p); + return; case USERDEFS_FOLY: if (iSet) + { ud.foly = lValue; - else - SetGameVarID(lVar2, ud.foly, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.foly, g_i, g_p); + return; case USERDEFS_FOLA: if (iSet) + { ud.fola = lValue; - else - SetGameVarID(lVar2, ud.fola, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.fola, g_i, g_p); + return; case USERDEFS_RECCNT: if (iSet) + { ud.reccnt = lValue; - else - SetGameVarID(lVar2, ud.reccnt, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.reccnt, g_i, g_p); + return; case USERDEFS_ENTERED_NAME: if (iSet) + { ud.entered_name = lValue; - else - SetGameVarID(lVar2, ud.entered_name, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.entered_name, g_i, g_p); + return; case USERDEFS_SCREEN_TILTING: if (iSet) + { ud.screen_tilting = lValue; - else - SetGameVarID(lVar2, ud.screen_tilting, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.screen_tilting, g_i, g_p); + return; case USERDEFS_SHADOWS: if (iSet) + { ud.shadows = lValue; - else - SetGameVarID(lVar2, ud.shadows, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.shadows, g_i, g_p); + return; case USERDEFS_FTA_ON: if (iSet) + { ud.fta_on = lValue; - else - SetGameVarID(lVar2, ud.fta_on, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.fta_on, g_i, g_p); + return; case USERDEFS_EXECUTIONS: if (iSet) + { ud.executions = lValue; - else - SetGameVarID(lVar2, ud.executions, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.executions, g_i, g_p); + return; case USERDEFS_AUTO_RUN: if (iSet) + { ud.auto_run = lValue; - else - SetGameVarID(lVar2, ud.auto_run, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.auto_run, g_i, g_p); + return; case USERDEFS_COORDS: if (iSet) + { ud.coords = lValue; - else - SetGameVarID(lVar2, ud.coords, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.coords, g_i, g_p); + return; case USERDEFS_TICKRATE: if (iSet) + { ud.tickrate = lValue; - else - SetGameVarID(lVar2, ud.tickrate, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.tickrate, g_i, g_p); + return; case USERDEFS_M_COOP: if (iSet) + { ud.m_coop = lValue; - else - SetGameVarID(lVar2, ud.m_coop, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_coop, g_i, g_p); + return; case USERDEFS_COOP: if (iSet) + { ud.coop = lValue; - else - SetGameVarID(lVar2, ud.coop, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.coop, g_i, g_p); + return; case USERDEFS_SCREEN_SIZE: if (iSet) { - if (ud.screen_size != lValue) { - ud.screen_size = lValue; - vscrn(); + if (ud.screen_size != lValue) + { + ud.screen_size = lValue; + vscrn(); + } } + return; } - else - SetGameVarID(lVar2, ud.screen_size, g_i, g_p); - break; + SetGameVarID(lVar2, ud.screen_size, g_i, g_p); + return; case USERDEFS_LOCKOUT: if (iSet) + { ud.lockout = lValue; - else - SetGameVarID(lVar2, ud.lockout, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.lockout, g_i, g_p); + return; case USERDEFS_CROSSHAIR: if (iSet) + { ud.crosshair = lValue; - else - SetGameVarID(lVar2, ud.crosshair, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.crosshair, g_i, g_p); + return; // case USERDEFS_WCHOICE: // if(iSet) // { // ud.wchoice = lValue; // } - // else + // return; } // { // SetGameVarID(lVar2, ud.wchoice, g_i, g_p); // } - // break; + // return; case USERDEFS_PLAYERAI: if (iSet) + { ud.playerai = lValue; - else - SetGameVarID(lVar2, ud.playerai, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.playerai, g_i, g_p); + return; case USERDEFS_RESPAWN_MONSTERS: if (iSet) + { ud.respawn_monsters = lValue; - else - SetGameVarID(lVar2, ud.respawn_monsters, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.respawn_monsters, g_i, g_p); + return; case USERDEFS_RESPAWN_ITEMS: if (iSet) + { ud.respawn_items = lValue; - else - SetGameVarID(lVar2, ud.respawn_items, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.respawn_items, g_i, g_p); + return; case USERDEFS_RESPAWN_INVENTORY: if (iSet) + { ud.respawn_inventory = lValue; - else - SetGameVarID(lVar2, ud.respawn_inventory, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.respawn_inventory, g_i, g_p); + return; case USERDEFS_RECSTAT: if (iSet) + { ud.recstat = lValue; - else - SetGameVarID(lVar2, ud.recstat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.recstat, g_i, g_p); + return; case USERDEFS_MONSTERS_OFF: if (iSet) + { ud.monsters_off = lValue; - else - SetGameVarID(lVar2, ud.monsters_off, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.monsters_off, g_i, g_p); + return; case USERDEFS_BRIGHTNESS: if (iSet) + { ud.brightness = lValue; - else - SetGameVarID(lVar2, ud.brightness, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.brightness, g_i, g_p); + return; case USERDEFS_M_RESPAWN_ITEMS: if (iSet) + { ud.m_respawn_items = lValue; - else - SetGameVarID(lVar2, ud.m_respawn_items, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_respawn_items, g_i, g_p); + return; case USERDEFS_M_RESPAWN_MONSTERS: if (iSet) + { ud.m_respawn_monsters = lValue; - else - SetGameVarID(lVar2, ud.m_respawn_monsters, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_respawn_monsters, g_i, g_p); + return; case USERDEFS_M_RESPAWN_INVENTORY: if (iSet) + { ud.m_respawn_inventory = lValue; - else - SetGameVarID(lVar2, ud.m_respawn_inventory, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_respawn_inventory, g_i, g_p); + return; case USERDEFS_M_RECSTAT: if (iSet) + { ud.m_recstat = lValue; - else - SetGameVarID(lVar2, ud.m_recstat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_recstat, g_i, g_p); + return; case USERDEFS_M_MONSTERS_OFF: if (iSet) + { ud.m_monsters_off = lValue; - else - SetGameVarID(lVar2, ud.m_monsters_off, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_monsters_off, g_i, g_p); + return; case USERDEFS_DETAIL: if (iSet) + { ud.detail = lValue; - else - SetGameVarID(lVar2, ud.detail, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.detail, g_i, g_p); + return; case USERDEFS_M_FFIRE: if (iSet) + { ud.m_ffire = lValue; - else - SetGameVarID(lVar2, ud.m_ffire, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_ffire, g_i, g_p); + return; case USERDEFS_FFIRE: if (iSet) + { ud.ffire = lValue; - else - SetGameVarID(lVar2, ud.ffire, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.ffire, g_i, g_p); + return; case USERDEFS_M_PLAYER_SKILL: if (iSet) + { ud.m_player_skill = lValue; - else - SetGameVarID(lVar2, ud.m_player_skill, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_player_skill, g_i, g_p); + return; case USERDEFS_M_LEVEL_NUMBER: if (iSet) + { ud.m_level_number = lValue; - else - SetGameVarID(lVar2, ud.m_level_number, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_level_number, g_i, g_p); + return; case USERDEFS_M_VOLUME_NUMBER: if (iSet) + { ud.m_volume_number = lValue; - else - SetGameVarID(lVar2, ud.m_volume_number, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_volume_number, g_i, g_p); + return; case USERDEFS_MULTIMODE: if (iSet) + { ud.multimode = lValue; - else - SetGameVarID(lVar2, ud.multimode, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.multimode, g_i, g_p); + return; case USERDEFS_PLAYER_SKILL: if (iSet) + { ud.player_skill = lValue; - else - SetGameVarID(lVar2, ud.player_skill, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.player_skill, g_i, g_p); + return; case USERDEFS_LEVEL_NUMBER: if (iSet) + { ud.level_number = lValue; - else - SetGameVarID(lVar2, ud.level_number, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.level_number, g_i, g_p); + return; case USERDEFS_VOLUME_NUMBER: if (iSet) + { ud.volume_number = lValue; - else - SetGameVarID(lVar2, ud.volume_number, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.volume_number, g_i, g_p); + return; case USERDEFS_M_MARKER: if (iSet) + { ud.m_marker = lValue; - else - SetGameVarID(lVar2, ud.m_marker, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_marker, g_i, g_p); + return; case USERDEFS_MARKER: if (iSet) + { ud.marker = lValue; - else - SetGameVarID(lVar2, ud.marker, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.marker, g_i, g_p); + return; case USERDEFS_MOUSEFLIP: if (iSet) + { ud.mouseflip = lValue; - else - SetGameVarID(lVar2, ud.mouseflip, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.mouseflip, g_i, g_p); + return; case USERDEFS_STATUSBARSCALE: if (iSet) + { ud.statusbarscale = lValue; - else - SetGameVarID(lVar2, ud.statusbarscale, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.statusbarscale, g_i, g_p); + return; case USERDEFS_DRAWWEAPON: if (iSet) + { ud.drawweapon = lValue; - else - SetGameVarID(lVar2, ud.drawweapon, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.drawweapon, g_i, g_p); + return; case USERDEFS_MOUSEAIMING: if (iSet) + { ud.mouseaiming = lValue; - else - SetGameVarID(lVar2, ud.mouseaiming, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.mouseaiming, g_i, g_p); + return; case USERDEFS_WEAPONSWITCH: if (iSet) + { ud.weaponswitch = lValue; - else - SetGameVarID(lVar2, ud.weaponswitch, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.weaponswitch, g_i, g_p); + return; case USERDEFS_DEMOCAMS: if (iSet) + { ud.democams = lValue; - else - SetGameVarID(lVar2, ud.democams, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.democams, g_i, g_p); + return; case USERDEFS_COLOR: if (iSet) + { ud.color = lValue; - else - SetGameVarID(lVar2, ud.color, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.color, g_i, g_p); + return; case USERDEFS_MSGDISPTIME: if (iSet) + { ud.msgdisptime = lValue; - else - SetGameVarID(lVar2, ud.msgdisptime, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.msgdisptime, g_i, g_p); + return; case USERDEFS_STATUSBARMODE: if (iSet) + { ud.statusbarmode = lValue; - else - SetGameVarID(lVar2, ud.statusbarmode, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.statusbarmode, g_i, g_p); + return; case USERDEFS_M_NOEXITS: if (iSet) + { ud.m_noexits = lValue; - else - SetGameVarID(lVar2, ud.m_noexits, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.m_noexits, g_i, g_p); + return; case USERDEFS_NOEXITS: if (iSet) + { ud.noexits = lValue; - else - SetGameVarID(lVar2, ud.noexits, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.noexits, g_i, g_p); + return; case USERDEFS_AUTOVOTE: if (iSet) + { ud.autovote = lValue; - else - SetGameVarID(lVar2, ud.autovote, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.autovote, g_i, g_p); + return; case USERDEFS_AUTOMSG: if (iSet) + { ud.automsg = lValue; - else - SetGameVarID(lVar2, ud.automsg, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.automsg, g_i, g_p); + return; case USERDEFS_IDPLAYERS: if (iSet) + { ud.idplayers = lValue; - else - SetGameVarID(lVar2, ud.idplayers, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.idplayers, g_i, g_p); + return; case USERDEFS_TEAM: if (iSet) + { ud.team = lValue; - else - SetGameVarID(lVar2, ud.team, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.team, g_i, g_p); + return; case USERDEFS_VIEWBOB: if (iSet) + { ud.viewbob = lValue; - else - SetGameVarID(lVar2, ud.viewbob, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.viewbob, g_i, g_p); + return; case USERDEFS_WEAPONSWAY: if (iSet) + { ud.weaponsway = lValue; - else - SetGameVarID(lVar2, ud.weaponsway, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.weaponsway, g_i, g_p); + return; case USERDEFS_ANGLEINTERPOLATION: if (iSet) + { ud.angleinterpolation = lValue; - else - SetGameVarID(lVar2, ud.angleinterpolation, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.angleinterpolation, g_i, g_p); + return; case USERDEFS_DEATHMSGS: if (iSet) + { ud.deathmsgs = lValue; - else - SetGameVarID(lVar2, ud.deathmsgs, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, ud.deathmsgs, g_i, g_p); + return; default: - break; + return; } - return; } static void DoThisProjectile(int iSet, int lVar1, int lLabelID, int lVar2) @@ -712,8 +876,7 @@ static void DoThisProjectile(int iSet, int lVar1, int lLabelID, int lVar2) if (proj < 0 || proj >= MAXSPRITES) { OSD_Printf("DoThisProjectile(): invalid projectile (%d)\n",proj); - if (lVar2 == MAXGAMEVARS) - insptr++; + insptr += (lVar2 == MAXGAMEVARS); return; } @@ -723,204 +886,259 @@ static void DoThisProjectile(int iSet, int lVar1, int lLabelID, int lVar2) { case PROJ_WORKSLIKE: if (iSet) + { hittype[proj].projectile.workslike=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.workslike, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.workslike, g_i, g_p); + return; case PROJ_SPAWNS: if (iSet) + { hittype[proj].projectile.spawns=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.spawns, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.spawns, g_i, g_p); + return; case PROJ_SXREPEAT: if (iSet) + { hittype[proj].projectile.sxrepeat=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.sxrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.sxrepeat, g_i, g_p); + return; case PROJ_SYREPEAT: if (iSet) + { hittype[proj].projectile.syrepeat=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.syrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.syrepeat, g_i, g_p); + return; case PROJ_SOUND: if (iSet) + { hittype[proj].projectile.sound=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.sound, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.sound, g_i, g_p); + return; case PROJ_ISOUND: if (iSet) + { hittype[proj].projectile.isound=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.isound, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.isound, g_i, g_p); + return; case PROJ_VEL: if (iSet) + { hittype[proj].projectile.vel=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.vel, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.vel, g_i, g_p); + return; case PROJ_EXTRA: if (iSet) + { hittype[proj].projectile.extra=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.extra, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.extra, g_i, g_p); + return; case PROJ_DECAL: if (iSet) + { hittype[proj].projectile.decal=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.decal, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.decal, g_i, g_p); + return; case PROJ_TRAIL: if (iSet) + { hittype[proj].projectile.trail=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.trail, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.trail, g_i, g_p); + return; case PROJ_TXREPEAT: if (iSet) + { hittype[proj].projectile.txrepeat=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.txrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.txrepeat, g_i, g_p); + return; case PROJ_TYREPEAT: if (iSet) + { hittype[proj].projectile.tyrepeat=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.tyrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.tyrepeat, g_i, g_p); + return; case PROJ_TOFFSET: if (iSet) + { hittype[proj].projectile.toffset=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.toffset, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.toffset, g_i, g_p); + return; case PROJ_TNUM: if (iSet) + { hittype[proj].projectile.tnum=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.tnum, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.tnum, g_i, g_p); + return; case PROJ_DROP: if (iSet) + { hittype[proj].projectile.drop=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.drop, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.drop, g_i, g_p); + return; case PROJ_CSTAT: if (iSet) + { hittype[proj].projectile.cstat=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.cstat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.cstat, g_i, g_p); + return; case PROJ_CLIPDIST: if (iSet) + { hittype[proj].projectile.clipdist=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.clipdist, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.clipdist, g_i, g_p); + return; case PROJ_SHADE: if (iSet) + { hittype[proj].projectile.shade=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.shade, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.shade, g_i, g_p); + return; case PROJ_XREPEAT: if (iSet) + { hittype[proj].projectile.xrepeat=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.xrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.xrepeat, g_i, g_p); + return; case PROJ_YREPEAT: if (iSet) + { hittype[proj].projectile.yrepeat=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.yrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.yrepeat, g_i, g_p); + return; case PROJ_PAL: if (iSet) + { hittype[proj].projectile.pal=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.pal, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.pal, g_i, g_p); + return; case PROJ_EXTRA_RAND: if (iSet) + { hittype[proj].projectile.extra_rand=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.extra_rand, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.extra_rand, g_i, g_p); + return; case PROJ_HITRADIUS: if (iSet) + { hittype[proj].projectile.hitradius=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.hitradius, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.hitradius, g_i, g_p); + return; case PROJ_VEL_MULT: if (iSet) + { hittype[proj].projectile.velmult=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.velmult, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.velmult, g_i, g_p); + return; case PROJ_OFFSET: if (iSet) + { hittype[proj].projectile.offset=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.offset, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.offset, g_i, g_p); + return; case PROJ_BOUNCES: if (iSet) + { hittype[proj].projectile.bounces=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.bounces, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.bounces, g_i, g_p); + return; case PROJ_BSOUND: if (iSet) + { hittype[proj].projectile.bsound=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.bsound, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.bsound, g_i, g_p); + return; case PROJ_RANGE: if (iSet) + { hittype[proj].projectile.range=lValue; - else - SetGameVarID(lVar2, hittype[proj].projectile.range, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[proj].projectile.range, g_i, g_p); + return; default: - break; + return; } - return; } static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) @@ -934,8 +1152,7 @@ static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) if (iPlayer<0 || iPlayer >= ud.multimode) { - if (lVar2 == MAXGAMEVARS) - insptr++; + insptr += (lVar2 == MAXGAMEVARS); OSD_Printf("DoPlayer(): invalid target player (%d) %d\n",iPlayer,g_i); return; } @@ -946,1039 +1163,1326 @@ static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) { case PLAYER_ZOOM: if (iSet) + { g_player[iPlayer].ps->zoom=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->zoom, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->zoom, g_i, g_p); + return; case PLAYER_EXITX: if (iSet) + { g_player[iPlayer].ps->exitx=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->exitx, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->exitx, g_i, g_p); + return; case PLAYER_EXITY: if (iSet) + { g_player[iPlayer].ps->exity=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->exity, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->exity, g_i, g_p); + return; case PLAYER_LOOGIEX: lTemp=lParm2; if (iSet) + { g_player[iPlayer].ps->loogiex[lTemp]=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->loogiex[lTemp], g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->loogiex[lTemp], g_i, g_p); + return; case PLAYER_LOOGIEY: lTemp=lParm2; if (iSet) + { g_player[iPlayer].ps->loogiey[lTemp]=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->loogiey[lTemp], g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->loogiey[lTemp], g_i, g_p); + return; case PLAYER_NUMLOOGS: if (iSet) + { g_player[iPlayer].ps->numloogs=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->numloogs, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->numloogs, g_i, g_p); + return; case PLAYER_LOOGCNT: if (iSet) + { g_player[iPlayer].ps->loogcnt=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->loogcnt, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->loogcnt, g_i, g_p); + return; case PLAYER_POSX: if (iSet) + { g_player[iPlayer].ps->posx=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->posx, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->posx, g_i, g_p); + return; case PLAYER_POSY: if (iSet) + { g_player[iPlayer].ps->posy=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->posy, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->posy, g_i, g_p); + return; case PLAYER_POSZ: if (iSet) + { g_player[iPlayer].ps->posz=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->posz, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->posz, g_i, g_p); + return; case PLAYER_HORIZ: if (iSet) + { g_player[iPlayer].ps->horiz=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->horiz, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->horiz, g_i, g_p); + return; case PLAYER_OHORIZ: if (iSet) + { g_player[iPlayer].ps->ohoriz=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->ohoriz, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->ohoriz, g_i, g_p); + return; case PLAYER_OHORIZOFF: if (iSet) + { g_player[iPlayer].ps->ohorizoff=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->ohorizoff, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->ohorizoff, g_i, g_p); + return; case PLAYER_INVDISPTIME: if (iSet) + { g_player[iPlayer].ps->invdisptime=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->invdisptime, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->invdisptime, g_i, g_p); + return; case PLAYER_BOBPOSX: if (iSet) + { g_player[iPlayer].ps->bobposx=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->bobposx, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->bobposx, g_i, g_p); + return; case PLAYER_BOBPOSY: if (iSet) + { g_player[iPlayer].ps->bobposy=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->bobposy, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->bobposy, g_i, g_p); + return; case PLAYER_OPOSX: if (iSet) + { g_player[iPlayer].ps->oposx=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->oposx, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->oposx, g_i, g_p); + return; case PLAYER_OPOSY: if (iSet) + { g_player[iPlayer].ps->oposy=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->oposy, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->oposy, g_i, g_p); + return; case PLAYER_OPOSZ: if (iSet) + { g_player[iPlayer].ps->oposz=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->oposz, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->oposz, g_i, g_p); + return; case PLAYER_PYOFF: if (iSet) + { g_player[iPlayer].ps->pyoff=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->pyoff, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->pyoff, g_i, g_p); + return; case PLAYER_OPYOFF: if (iSet) + { g_player[iPlayer].ps->opyoff=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->opyoff, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->opyoff, g_i, g_p); + return; case PLAYER_POSXV: if (iSet) + { g_player[iPlayer].ps->posxv=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->posxv, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->posxv, g_i, g_p); + return; case PLAYER_POSYV: if (iSet) + { g_player[iPlayer].ps->posyv=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->posyv, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->posyv, g_i, g_p); + return; case PLAYER_POSZV: if (iSet) + { g_player[iPlayer].ps->poszv=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->poszv, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->poszv, g_i, g_p); + return; case PLAYER_LAST_PISSED_TIME: if (iSet) + { g_player[iPlayer].ps->last_pissed_time=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->last_pissed_time, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->last_pissed_time, g_i, g_p); + return; case PLAYER_TRUEFZ: if (iSet) + { g_player[iPlayer].ps->truefz=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->truefz, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->truefz, g_i, g_p); + return; case PLAYER_TRUECZ: if (iSet) + { g_player[iPlayer].ps->truecz=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->truecz, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->truecz, g_i, g_p); + return; case PLAYER_PLAYER_PAR: if (iSet) + { g_player[iPlayer].ps->player_par=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->player_par, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->player_par, g_i, g_p); + return; case PLAYER_VISIBILITY: if (iSet) + { g_player[iPlayer].ps->visibility=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->visibility, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->visibility, g_i, g_p); + return; case PLAYER_BOBCOUNTER: if (iSet) + { g_player[iPlayer].ps->bobcounter=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->bobcounter, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->bobcounter, g_i, g_p); + return; case PLAYER_WEAPON_SWAY: if (iSet) + { g_player[iPlayer].ps->weapon_sway=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->weapon_sway, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->weapon_sway, g_i, g_p); + return; case PLAYER_PALS_TIME: if (iSet) + { g_player[iPlayer].ps->pals_time=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->pals_time, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->pals_time, g_i, g_p); + return; case PLAYER_RANDOMFLAMEX: if (iSet) + { g_player[iPlayer].ps->randomflamex=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->randomflamex, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->randomflamex, g_i, g_p); + return; case PLAYER_CRACK_TIME: if (iSet) + { g_player[iPlayer].ps->crack_time=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->crack_time, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->crack_time, g_i, g_p); + return; case PLAYER_AIM_MODE: if (iSet) + { g_player[iPlayer].ps->aim_mode=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->aim_mode, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->aim_mode, g_i, g_p); + return; case PLAYER_ANG: if (iSet) + { g_player[iPlayer].ps->ang=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->ang, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->ang, g_i, g_p); + return; case PLAYER_OANG: if (iSet) + { g_player[iPlayer].ps->oang=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->oang, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->oang, g_i, g_p); + return; case PLAYER_ANGVEL: if (iSet) + { g_player[iPlayer].ps->angvel=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->angvel, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->angvel, g_i, g_p); + return; case PLAYER_CURSECTNUM: if (iSet) + { g_player[iPlayer].ps->cursectnum=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->cursectnum, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->cursectnum, g_i, g_p); + return; case PLAYER_LOOK_ANG: if (iSet) + { g_player[iPlayer].ps->look_ang=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->look_ang, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->look_ang, g_i, g_p); + return; case PLAYER_LAST_EXTRA: if (iSet) + { g_player[iPlayer].ps->last_extra=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->last_extra, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->last_extra, g_i, g_p); + return; case PLAYER_SUBWEAPON: if (iSet) + { g_player[iPlayer].ps->subweapon=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->subweapon, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->subweapon, g_i, g_p); + return; case PLAYER_AMMO_AMOUNT: lTemp=lParm2; if (iSet) + { g_player[iPlayer].ps->ammo_amount[lTemp]=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->ammo_amount[lTemp], g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->ammo_amount[lTemp], g_i, g_p); + return; case PLAYER_WACKEDBYACTOR: if (iSet) + { g_player[iPlayer].ps->wackedbyactor=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->wackedbyactor, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->wackedbyactor, g_i, g_p); + return; case PLAYER_FRAG: if (iSet) + { g_player[iPlayer].ps->frag=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->frag, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->frag, g_i, g_p); + return; case PLAYER_FRAGGEDSELF: if (iSet) + { g_player[iPlayer].ps->fraggedself=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->fraggedself, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->fraggedself, g_i, g_p); + return; case PLAYER_CURR_WEAPON: if (iSet) + { g_player[iPlayer].ps->curr_weapon=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->curr_weapon, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->curr_weapon, g_i, g_p); + return; case PLAYER_LAST_WEAPON: if (iSet) + { g_player[iPlayer].ps->last_weapon=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->last_weapon, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->last_weapon, g_i, g_p); + return; case PLAYER_TIPINCS: if (iSet) + { g_player[iPlayer].ps->tipincs=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->tipincs, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->tipincs, g_i, g_p); + return; case PLAYER_HORIZOFF: if (iSet) + { g_player[iPlayer].ps->horizoff=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->horizoff, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->horizoff, g_i, g_p); + return; case PLAYER_WANTWEAPONFIRE: if (iSet) + { g_player[iPlayer].ps->wantweaponfire=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->wantweaponfire, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->wantweaponfire, g_i, g_p); + return; case PLAYER_HOLODUKE_AMOUNT: if (iSet) + { g_player[iPlayer].ps->holoduke_amount=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->holoduke_amount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->holoduke_amount, g_i, g_p); + return; case PLAYER_NEWOWNER: if (iSet) + { g_player[iPlayer].ps->newowner=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->newowner, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->newowner, g_i, g_p); + return; case PLAYER_HURT_DELAY: if (iSet) + { g_player[iPlayer].ps->hurt_delay=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->hurt_delay, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->hurt_delay, g_i, g_p); + return; case PLAYER_HBOMB_HOLD_DELAY: if (iSet) + { g_player[iPlayer].ps->hbomb_hold_delay=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->hbomb_hold_delay, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->hbomb_hold_delay, g_i, g_p); + return; case PLAYER_JUMPING_COUNTER: if (iSet) + { g_player[iPlayer].ps->jumping_counter=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->jumping_counter, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->jumping_counter, g_i, g_p); + return; case PLAYER_AIRLEFT: if (iSet) + { g_player[iPlayer].ps->airleft=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->airleft, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->airleft, g_i, g_p); + return; case PLAYER_KNEE_INCS: if (iSet) + { g_player[iPlayer].ps->knee_incs=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->knee_incs, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->knee_incs, g_i, g_p); + return; case PLAYER_ACCESS_INCS: if (iSet) + { g_player[iPlayer].ps->access_incs=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->access_incs, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->access_incs, g_i, g_p); + return; case PLAYER_FTA: if (iSet) + { g_player[iPlayer].ps->fta=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->fta, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->fta, g_i, g_p); + return; case PLAYER_FTQ: if (iSet) + { g_player[iPlayer].ps->ftq=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->ftq, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->ftq, g_i, g_p); + return; case PLAYER_ACCESS_WALLNUM: if (iSet) + { g_player[iPlayer].ps->access_wallnum=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->access_wallnum, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->access_wallnum, g_i, g_p); + return; case PLAYER_ACCESS_SPRITENUM: if (iSet) + { g_player[iPlayer].ps->access_spritenum=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->access_spritenum, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->access_spritenum, g_i, g_p); + return; case PLAYER_KICKBACK_PIC: if (iSet) + { g_player[iPlayer].ps->kickback_pic=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->kickback_pic, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->kickback_pic, g_i, g_p); + return; case PLAYER_GOT_ACCESS: if (iSet) + { g_player[iPlayer].ps->got_access=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->got_access, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->got_access, g_i, g_p); + return; case PLAYER_WEAPON_ANG: if (iSet) + { g_player[iPlayer].ps->weapon_ang=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->weapon_ang, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->weapon_ang, g_i, g_p); + return; case PLAYER_FIRSTAID_AMOUNT: if (iSet) + { g_player[iPlayer].ps->firstaid_amount=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->firstaid_amount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->firstaid_amount, g_i, g_p); + return; case PLAYER_SOMETHINGONPLAYER: if (iSet) + { g_player[iPlayer].ps->somethingonplayer=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->somethingonplayer, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->somethingonplayer, g_i, g_p); + return; case PLAYER_ON_CRANE: if (iSet) + { g_player[iPlayer].ps->on_crane=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->on_crane, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->on_crane, g_i, g_p); + return; case PLAYER_I: if (iSet) + { g_player[iPlayer].ps->i=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->i, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->i, g_i, g_p); + return; case PLAYER_ONE_PARALLAX_SECTNUM: if (iSet) + { g_player[iPlayer].ps->one_parallax_sectnum=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->one_parallax_sectnum, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->one_parallax_sectnum, g_i, g_p); + return; case PLAYER_OVER_SHOULDER_ON: if (iSet) + { g_player[iPlayer].ps->over_shoulder_on=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->over_shoulder_on, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->over_shoulder_on, g_i, g_p); + return; case PLAYER_RANDOM_CLUB_FRAME: if (iSet) + { g_player[iPlayer].ps->random_club_frame=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->random_club_frame, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->random_club_frame, g_i, g_p); + return; case PLAYER_FIST_INCS: if (iSet) + { g_player[iPlayer].ps->fist_incs=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->fist_incs, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->fist_incs, g_i, g_p); + return; case PLAYER_ONE_EIGHTY_COUNT: if (iSet) + { g_player[iPlayer].ps->one_eighty_count=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->one_eighty_count, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->one_eighty_count, g_i, g_p); + return; case PLAYER_CHEAT_PHASE: if (iSet) + { g_player[iPlayer].ps->cheat_phase=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->cheat_phase, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->cheat_phase, g_i, g_p); + return; case PLAYER_DUMMYPLAYERSPRITE: if (iSet) + { g_player[iPlayer].ps->dummyplayersprite=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->dummyplayersprite, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->dummyplayersprite, g_i, g_p); + return; case PLAYER_EXTRA_EXTRA8: if (iSet) + { g_player[iPlayer].ps->extra_extra8=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->extra_extra8, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->extra_extra8, g_i, g_p); + return; case PLAYER_QUICK_KICK: if (iSet) + { g_player[iPlayer].ps->quick_kick=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->quick_kick, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->quick_kick, g_i, g_p); + return; case PLAYER_HEAT_AMOUNT: if (iSet) + { g_player[iPlayer].ps->heat_amount=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->heat_amount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->heat_amount, g_i, g_p); + return; case PLAYER_ACTORSQU: if (iSet) + { g_player[iPlayer].ps->actorsqu=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->actorsqu, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->actorsqu, g_i, g_p); + return; case PLAYER_TIMEBEFOREEXIT: if (iSet) + { g_player[iPlayer].ps->timebeforeexit=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->timebeforeexit, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->timebeforeexit, g_i, g_p); + return; case PLAYER_CUSTOMEXITSOUND: if (iSet) + { g_player[iPlayer].ps->customexitsound=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->customexitsound, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->customexitsound, g_i, g_p); + return; case PLAYER_WEAPRECS: if (iSet) + { g_player[iPlayer].ps->weaprecs[16]=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->weaprecs[16], g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->weaprecs[16], g_i, g_p); + return; case PLAYER_WEAPRECCNT: if (iSet) + { g_player[iPlayer].ps->weapreccnt=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->weapreccnt, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->weapreccnt, g_i, g_p); + return; case PLAYER_INTERFACE_TOGGLE_FLAG: if (iSet) + { g_player[iPlayer].ps->interface_toggle_flag=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->interface_toggle_flag, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->interface_toggle_flag, g_i, g_p); + return; case PLAYER_ROTSCRNANG: if (iSet) + { g_player[iPlayer].ps->rotscrnang=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->rotscrnang, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->rotscrnang, g_i, g_p); + return; case PLAYER_DEAD_FLAG: if (iSet) + { g_player[iPlayer].ps->dead_flag=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->dead_flag, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->dead_flag, g_i, g_p); + return; case PLAYER_SHOW_EMPTY_WEAPON: if (iSet) + { g_player[iPlayer].ps->show_empty_weapon=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->show_empty_weapon, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->show_empty_weapon, g_i, g_p); + return; case PLAYER_SCUBA_AMOUNT: if (iSet) + { g_player[iPlayer].ps->scuba_amount=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->scuba_amount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->scuba_amount, g_i, g_p); + return; case PLAYER_JETPACK_AMOUNT: if (iSet) + { g_player[iPlayer].ps->jetpack_amount=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->jetpack_amount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->jetpack_amount, g_i, g_p); + return; case PLAYER_STEROIDS_AMOUNT: if (iSet) + { g_player[iPlayer].ps->steroids_amount=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->steroids_amount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->steroids_amount, g_i, g_p); + return; case PLAYER_SHIELD_AMOUNT: if (iSet) + { g_player[iPlayer].ps->shield_amount=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->shield_amount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->shield_amount, g_i, g_p); + return; case PLAYER_HOLODUKE_ON: if (iSet) + { g_player[iPlayer].ps->holoduke_on=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->holoduke_on, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->holoduke_on, g_i, g_p); + return; case PLAYER_PYCOUNT: if (iSet) + { g_player[iPlayer].ps->pycount=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->pycount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->pycount, g_i, g_p); + return; case PLAYER_WEAPON_POS: if (iSet) + { g_player[iPlayer].ps->weapon_pos=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->weapon_pos, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->weapon_pos, g_i, g_p); + return; case PLAYER_FRAG_PS: if (iSet) + { g_player[iPlayer].ps->frag_ps=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->frag_ps, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->frag_ps, g_i, g_p); + return; case PLAYER_TRANSPORTER_HOLD: if (iSet) + { g_player[iPlayer].ps->transporter_hold=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->transporter_hold, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->transporter_hold, g_i, g_p); + return; case PLAYER_LAST_FULL_WEAPON: if (iSet) + { g_player[iPlayer].ps->last_full_weapon=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->last_full_weapon, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->last_full_weapon, g_i, g_p); + return; case PLAYER_FOOTPRINTSHADE: if (iSet) + { g_player[iPlayer].ps->footprintshade=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->footprintshade, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->footprintshade, g_i, g_p); + return; case PLAYER_BOOT_AMOUNT: if (iSet) + { g_player[iPlayer].ps->boot_amount=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->boot_amount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->boot_amount, g_i, g_p); + return; case PLAYER_SCREAM_VOICE: if (iSet) + { g_player[iPlayer].ps->scream_voice=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->scream_voice, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->scream_voice, g_i, g_p); + return; case PLAYER_GM: if (iSet) + { g_player[iPlayer].ps->gm=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->gm, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->gm, g_i, g_p); + return; case PLAYER_ON_WARPING_SECTOR: if (iSet) + { g_player[iPlayer].ps->on_warping_sector=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->on_warping_sector, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->on_warping_sector, g_i, g_p); + return; case PLAYER_FOOTPRINTCOUNT: if (iSet) + { g_player[iPlayer].ps->footprintcount=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->footprintcount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->footprintcount, g_i, g_p); + return; case PLAYER_HBOMB_ON: if (iSet) + { g_player[iPlayer].ps->hbomb_on=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->hbomb_on, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->hbomb_on, g_i, g_p); + return; case PLAYER_JUMPING_TOGGLE: if (iSet) + { g_player[iPlayer].ps->jumping_toggle=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->jumping_toggle, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->jumping_toggle, g_i, g_p); + return; case PLAYER_RAPID_FIRE_HOLD: if (iSet) + { g_player[iPlayer].ps->rapid_fire_hold=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->rapid_fire_hold, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->rapid_fire_hold, g_i, g_p); + return; case PLAYER_ON_GROUND: if (iSet) + { g_player[iPlayer].ps->on_ground=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->on_ground, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->on_ground, g_i, g_p); + return; case PLAYER_NAME: if (iSet) + { g_player[iPlayer].ps->name[32]=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->name[32], g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->name[32], g_i, g_p); + return; case PLAYER_INVEN_ICON: if (iSet) + { g_player[iPlayer].ps->inven_icon=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->inven_icon, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->inven_icon, g_i, g_p); + return; case PLAYER_BUTTONPALETTE: if (iSet) + { g_player[iPlayer].ps->buttonpalette=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->buttonpalette, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->buttonpalette, g_i, g_p); + return; case PLAYER_JETPACK_ON: if (iSet) + { g_player[iPlayer].ps->jetpack_on=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->jetpack_on, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->jetpack_on, g_i, g_p); + return; case PLAYER_SPRITEBRIDGE: if (iSet) + { g_player[iPlayer].ps->spritebridge=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->spritebridge, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->spritebridge, g_i, g_p); + return; case PLAYER_LASTRANDOMSPOT: if (iSet) + { g_player[iPlayer].ps->lastrandomspot=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->lastrandomspot, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->lastrandomspot, g_i, g_p); + return; case PLAYER_SCUBA_ON: if (iSet) + { g_player[iPlayer].ps->scuba_on=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->scuba_on, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->scuba_on, g_i, g_p); + return; case PLAYER_FOOTPRINTPAL: if (iSet) + { g_player[iPlayer].ps->footprintpal=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->footprintpal, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->footprintpal, g_i, g_p); + return; case PLAYER_HEAT_ON: if (iSet) { - if (g_player[iPlayer].ps->heat_on != lValue) { - g_player[iPlayer].ps->heat_on=lValue; - setpal(g_player[iPlayer].ps); + if (g_player[iPlayer].ps->heat_on != lValue) + { + g_player[iPlayer].ps->heat_on=lValue; + setpal(g_player[iPlayer].ps); + } } + return; } - else - SetGameVarID(lVar2, g_player[iPlayer].ps->heat_on, g_i, g_p); - break; + SetGameVarID(lVar2, g_player[iPlayer].ps->heat_on, g_i, g_p); + return; case PLAYER_HOLSTER_WEAPON: if (iSet) + { g_player[iPlayer].ps->holster_weapon=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->holster_weapon, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->holster_weapon, g_i, g_p); + return; case PLAYER_FALLING_COUNTER: if (iSet) + { g_player[iPlayer].ps->falling_counter=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->falling_counter, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->falling_counter, g_i, g_p); + return; case PLAYER_GOTWEAPON: lTemp=lParm2; if (iSet) + { g_player[iPlayer].ps->gotweapon[lTemp]=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->gotweapon[lTemp], g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->gotweapon[lTemp], g_i, g_p); + return; case PLAYER_REFRESH_INVENTORY: if (iSet) + { g_player[iPlayer].ps->refresh_inventory=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->refresh_inventory, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->refresh_inventory, g_i, g_p); + return; // case PLAYER_PALETTE: // if(iSet) // { // g_player[iPlayer].ps->palette=lValue; // } - // else + // return; } // { // SetGameVarID(lVar2, g_player[iPlayer].ps->palette, g_i, g_p); // } - // break; + // return; case PLAYER_TOGGLE_KEY_FLAG: if (iSet) + { g_player[iPlayer].ps->toggle_key_flag=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->toggle_key_flag, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->toggle_key_flag, g_i, g_p); + return; case PLAYER_KNUCKLE_INCS: if (iSet) + { g_player[iPlayer].ps->knuckle_incs=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->knuckle_incs, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->knuckle_incs, g_i, g_p); + return; case PLAYER_WALKING_SND_TOGGLE: if (iSet) + { g_player[iPlayer].ps->walking_snd_toggle=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->walking_snd_toggle, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->walking_snd_toggle, g_i, g_p); + return; case PLAYER_PALOOKUP: if (iSet) + { g_player[iPlayer].ps->palookup=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->palookup, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->palookup, g_i, g_p); + return; case PLAYER_HARD_LANDING: if (iSet) + { g_player[iPlayer].ps->hard_landing=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->hard_landing, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->hard_landing, g_i, g_p); + return; case PLAYER_MAX_SECRET_ROOMS: if (iSet) + { g_player[iPlayer].ps->max_secret_rooms=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->max_secret_rooms, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->max_secret_rooms, g_i, g_p); + return; case PLAYER_SECRET_ROOMS: if (iSet) + { g_player[iPlayer].ps->secret_rooms=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->secret_rooms, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->secret_rooms, g_i, g_p); + return; case PLAYER_PALS: lTemp=lParm2; if (iSet) + { g_player[iPlayer].ps->pals[lTemp]=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->pals[lTemp], g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->pals[lTemp], g_i, g_p); + return; case PLAYER_MAX_ACTORS_KILLED: if (iSet) + { g_player[iPlayer].ps->max_actors_killed=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->max_actors_killed, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->max_actors_killed, g_i, g_p); + return; case PLAYER_ACTORS_KILLED: if (iSet) + { g_player[iPlayer].ps->actors_killed=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->actors_killed, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->actors_killed, g_i, g_p); + return; case PLAYER_RETURN_TO_CENTER: if (iSet) + { g_player[iPlayer].ps->return_to_center=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->return_to_center, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->return_to_center, g_i, g_p); + return; case PLAYER_RUNSPEED: if (iSet) + { g_player[iPlayer].ps->runspeed=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->runspeed, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->runspeed, g_i, g_p); + return; case PLAYER_SBS: if (iSet) + { g_player[iPlayer].ps->sbs=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->sbs, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->sbs, g_i, g_p); + return; case PLAYER_RELOADING: if (iSet) + { g_player[iPlayer].ps->reloading=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->reloading, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->reloading, g_i, g_p); + return; case PLAYER_AUTO_AIM: if (iSet) + { g_player[iPlayer].ps->auto_aim=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->auto_aim, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->auto_aim, g_i, g_p); + return; case PLAYER_MOVEMENT_LOCK: if (iSet) + { g_player[iPlayer].ps->movement_lock=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->movement_lock, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->movement_lock, g_i, g_p); + return; case PLAYER_SOUND_PITCH: if (iSet) + { g_player[iPlayer].ps->sound_pitch=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->sound_pitch, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->sound_pitch, g_i, g_p); + return; case PLAYER_WEAPONSWITCH: if (iSet) + { g_player[iPlayer].ps->weaponswitch=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->weaponswitch, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->weaponswitch, g_i, g_p); + return; case PLAYER_TEAM: if (iSet) + { g_player[iPlayer].ps->team=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->team, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->team, g_i, g_p); + return; case PLAYER_MAX_PLAYER_HEALTH: if (iSet) + { g_player[iPlayer].ps->max_player_health = lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->max_player_health, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->max_player_health, g_i, g_p); + return; case PLAYER_MAX_SHIELD_AMOUNT: if (iSet) + { g_player[iPlayer].ps->max_shield_amount = lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->max_shield_amount, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->max_shield_amount, g_i, g_p); + return; case PLAYER_MAX_AMMO_AMOUNT: lTemp=lParm2; if (iSet) + { g_player[iPlayer].ps->max_ammo_amount[lTemp]=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].ps->max_ammo_amount[lTemp], g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].ps->max_ammo_amount[lTemp], g_i, g_p); + return; default: - break; + return; } - return; } static void DoInput(int iSet, int lVar1, int lLabelID, int lVar2) @@ -1991,8 +2495,7 @@ static void DoInput(int iSet, int lVar1, int lLabelID, int lVar2) if (iPlayer<0 || iPlayer >= ud.multimode) { - if (lVar2 == MAXGAMEVARS) - insptr++; + insptr += (lVar2 == MAXGAMEVARS); OSD_Printf("DoInput(): invalid target player (%d) %d\n",iPlayer,g_i); return; } @@ -2003,49 +2506,60 @@ static void DoInput(int iSet, int lVar1, int lLabelID, int lVar2) { case INPUT_AVEL: if (iSet) + { g_player[iPlayer].sync->avel=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].sync->avel, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].sync->avel, g_i, g_p); + return; case INPUT_HORZ: if (iSet) + { g_player[iPlayer].sync->horz=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].sync->horz, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].sync->horz, g_i, g_p); + return; case INPUT_FVEL: if (iSet) + { g_player[iPlayer].sync->fvel=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].sync->fvel, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].sync->fvel, g_i, g_p); + return; case INPUT_SVEL: if (iSet) + { g_player[iPlayer].sync->svel=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].sync->svel, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].sync->svel, g_i, g_p); + return; case INPUT_BITS: if (iSet) + { g_player[iPlayer].sync->bits=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].sync->bits, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].sync->bits, g_i, g_p); + return; case INPUT_EXTBITS: if (iSet) + { g_player[iPlayer].sync->extbits=lValue; - else - SetGameVarID(lVar2, g_player[iPlayer].sync->extbits, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, g_player[iPlayer].sync->extbits, g_i, g_p); + return; default: - break; + return; } - return; } static void DoWall(int iSet, int lVar1, int lLabelID, int lVar2) @@ -2055,8 +2569,7 @@ static void DoWall(int iSet, int lVar1, int lLabelID, int lVar2) if (iWall<0 || iWall >= MAXWALLS) { - if (lVar2 == MAXGAMEVARS) - insptr++; + insptr += (lVar2 == MAXGAMEVARS); return; } @@ -2066,126 +2579,159 @@ static void DoWall(int iSet, int lVar1, int lLabelID, int lVar2) { case WALL_X: if (iSet) + { wall[iWall].x=lValue; - else - SetGameVarID(lVar2, wall[iWall].x, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].x, g_i, g_p); + return; case WALL_Y: if (iSet) + { wall[iWall].y=lValue; - else - SetGameVarID(lVar2, wall[iWall].y, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].y, g_i, g_p); + return; case WALL_POINT2: if (iSet) + { wall[iWall].point2=lValue; - else - SetGameVarID(lVar2, wall[iWall].point2, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].point2, g_i, g_p); + return; case WALL_NEXTWALL: if (iSet) + { wall[iWall].nextwall=lValue; - else - SetGameVarID(lVar2, wall[iWall].nextwall, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].nextwall, g_i, g_p); + return; case WALL_NEXTSECTOR: if (iSet) + { wall[iWall].nextsector=lValue; - else - SetGameVarID(lVar2, wall[iWall].nextsector, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].nextsector, g_i, g_p); + return; case WALL_CSTAT: if (iSet) + { wall[iWall].cstat=lValue; - else - SetGameVarID(lVar2, wall[iWall].cstat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].cstat, g_i, g_p); + return; case WALL_PICNUM: if (iSet) + { wall[iWall].picnum=lValue; - else - SetGameVarID(lVar2, wall[iWall].picnum, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].picnum, g_i, g_p); + return; case WALL_OVERPICNUM: if (iSet) + { wall[iWall].overpicnum=lValue; - else - SetGameVarID(lVar2, wall[iWall].overpicnum, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].overpicnum, g_i, g_p); + return; case WALL_SHADE: if (iSet) + { wall[iWall].shade=lValue; - else - SetGameVarID(lVar2, wall[iWall].shade, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].shade, g_i, g_p); + return; case WALL_PAL: if (iSet) + { wall[iWall].pal=lValue; - else - SetGameVarID(lVar2, wall[iWall].pal, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].pal, g_i, g_p); + return; case WALL_XREPEAT: if (iSet) + { wall[iWall].xrepeat=lValue; - else - SetGameVarID(lVar2, wall[iWall].xrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].xrepeat, g_i, g_p); + return; case WALL_YREPEAT: if (iSet) + { wall[iWall].yrepeat=lValue; - else - SetGameVarID(lVar2, wall[iWall].yrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].yrepeat, g_i, g_p); + return; case WALL_XPANNING: if (iSet) + { wall[iWall].xpanning=lValue; - else - SetGameVarID(lVar2, wall[iWall].xpanning, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].xpanning, g_i, g_p); + return; case WALL_YPANNING: if (iSet) + { wall[iWall].ypanning=lValue; - else - SetGameVarID(lVar2, wall[iWall].ypanning, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].ypanning, g_i, g_p); + return; case WALL_LOTAG: if (iSet) + { wall[iWall].lotag=lValue; - else - SetGameVarID(lVar2, wall[iWall].lotag, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].lotag, g_i, g_p); + return; case WALL_HITAG: if (iSet) + { wall[iWall].hitag=lValue; - else - SetGameVarID(lVar2, wall[iWall].hitag, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].hitag, g_i, g_p); + return; case WALL_EXTRA: if (iSet) + { wall[iWall].extra=lValue; - else - SetGameVarID(lVar2, wall[iWall].extra, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, wall[iWall].extra, g_i, g_p); + return; default: - break; + return; } - return; } static void DoSector(int iSet, int lVar1, int lLabelID, int lVar2) @@ -2198,8 +2744,7 @@ static void DoSector(int iSet, int lVar1, int lLabelID, int lVar2) if (iSector<0 || iSector >= MAXSECTORS) { - if (lVar2 == MAXGAMEVARS) - insptr++; + insptr += (lVar2 == MAXGAMEVARS); return; } @@ -2209,169 +2754,214 @@ static void DoSector(int iSet, int lVar1, int lLabelID, int lVar2) { case SECTOR_WALLPTR: if (iSet) + { sector[iSector].wallptr=lValue; - else - SetGameVarID(lVar2, sector[iSector].wallptr,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].wallptr,g_i,g_p); + return; case SECTOR_WALLNUM: if (iSet) + { sector[iSector].wallnum=lValue; - else - SetGameVarID(lVar2, sector[iSector].wallnum,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].wallnum,g_i,g_p); + return; case SECTOR_CEILINGZ: if (iSet) + { sector[iSector].ceilingz=lValue; - else - SetGameVarID(lVar2, sector[iSector].ceilingz,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].ceilingz,g_i,g_p); + return; case SECTOR_FLOORZ: if (iSet) + { sector[iSector].floorz=lValue; - else - SetGameVarID(lVar2, sector[iSector].floorz,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].floorz,g_i,g_p); + return; case SECTOR_CEILINGSTAT: if (iSet) + { sector[iSector].ceilingstat=lValue; - else - SetGameVarID(lVar2, sector[iSector].ceilingstat,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].ceilingstat,g_i,g_p); + return; case SECTOR_FLOORSTAT: if (iSet) + { sector[iSector].floorstat=lValue; - else - SetGameVarID(lVar2, sector[iSector].floorstat,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].floorstat,g_i,g_p); + return; case SECTOR_CEILINGPICNUM: if (iSet) + { sector[iSector].ceilingpicnum=lValue; - else - SetGameVarID(lVar2, sector[iSector].ceilingpicnum,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].ceilingpicnum,g_i,g_p); + return; case SECTOR_CEILINGSLOPE: if (iSet) + { sector[iSector].ceilingheinum=lValue; - else - SetGameVarID(lVar2, sector[iSector].ceilingheinum,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].ceilingheinum,g_i,g_p); + return; case SECTOR_CEILINGSHADE: if (iSet) + { sector[iSector].ceilingshade=lValue; - else - SetGameVarID(lVar2, sector[iSector].ceilingshade,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].ceilingshade,g_i,g_p); + return; case SECTOR_CEILINGPAL: if (iSet) + { sector[iSector].ceilingpal=lValue; - else - SetGameVarID(lVar2, sector[iSector].ceilingpal,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].ceilingpal,g_i,g_p); + return; case SECTOR_CEILINGXPANNING: if (iSet) + { sector[iSector].ceilingxpanning=lValue; - else - SetGameVarID(lVar2, sector[iSector].ceilingxpanning,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].ceilingxpanning,g_i,g_p); + return; case SECTOR_CEILINGYPANNING: if (iSet) + { sector[iSector].ceilingypanning=lValue; - else - SetGameVarID(lVar2, sector[iSector].ceilingypanning,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].ceilingypanning,g_i,g_p); + return; case SECTOR_FLOORPICNUM: if (iSet) + { sector[iSector].floorpicnum=lValue; - else - SetGameVarID(lVar2, sector[iSector].floorpicnum,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].floorpicnum,g_i,g_p); + return; case SECTOR_FLOORSLOPE: if (iSet) + { sector[iSector].floorheinum=lValue; - else - SetGameVarID(lVar2, sector[iSector].floorheinum,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].floorheinum,g_i,g_p); + return; case SECTOR_FLOORSHADE: if (iSet) + { sector[iSector].floorshade=lValue; - else - SetGameVarID(lVar2, sector[iSector].floorshade,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].floorshade,g_i,g_p); + return; case SECTOR_FLOORPAL: if (iSet) + { sector[iSector].floorpal=lValue; - else - SetGameVarID(lVar2, sector[iSector].floorpal,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].floorpal,g_i,g_p); + return; case SECTOR_FLOORXPANNING: if (iSet) + { sector[iSector].floorxpanning=lValue; - else - SetGameVarID(lVar2, sector[iSector].floorxpanning,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].floorxpanning,g_i,g_p); + return; case SECTOR_FLOORYPANNING: if (iSet) + { sector[iSector].floorypanning=lValue; - else - SetGameVarID(lVar2, sector[iSector].floorypanning,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].floorypanning,g_i,g_p); + return; case SECTOR_VISIBILITY: if (iSet) + { sector[iSector].visibility=lValue; - else - SetGameVarID(lVar2, sector[iSector].visibility,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].visibility,g_i,g_p); + return; case SECTOR_ALIGNTO: if (iSet) + { sector[iSector].filler=lValue; - else - SetGameVarID(lVar2, sector[iSector].filler,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].filler,g_i,g_p); + return; case SECTOR_LOTAG: if (iSet) + { sector[iSector].lotag=lValue; - else - SetGameVarID(lVar2, sector[iSector].lotag,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].lotag,g_i,g_p); + return; case SECTOR_HITAG: if (iSet) + { sector[iSector].hitag=lValue; - else - SetGameVarID(lVar2, sector[iSector].hitag,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].hitag,g_i,g_p); + return; case SECTOR_EXTRA: if (iSet) + { sector[iSector].extra=lValue; - else - SetGameVarID(lVar2, sector[iSector].extra,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sector[iSector].extra,g_i,g_p); + return; default: - break; + return; } - return; } static void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) @@ -2386,8 +2976,7 @@ static void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) if (iActor < 0 || iActor >= MAXSPRITES) { OSD_Printf("DoActor(): invalid target sprite (%d) %d %d\n",iActor,g_i,g_sp->picnum); - if (lVar2 == MAXGAMEVARS) - insptr++; + insptr += (lVar2 == MAXGAMEVARS); return; } @@ -2397,359 +2986,458 @@ static void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) { case ACTOR_X: if (iSet) + { sprite[iActor].x=lValue; - else - SetGameVarID(lVar2, sprite[iActor].x,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].x,g_i,g_p); + return; case ACTOR_Y: if (iSet) + { sprite[iActor].y=lValue; - else - SetGameVarID(lVar2, sprite[iActor].y,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].y,g_i,g_p); + return; case ACTOR_Z: if (iSet) + { sprite[iActor].z=lValue; - else - SetGameVarID(lVar2, sprite[iActor].z,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].z,g_i,g_p); + return; case ACTOR_CSTAT: if (iSet) + { sprite[iActor].cstat=lValue; - else - SetGameVarID(lVar2, sprite[iActor].cstat,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].cstat,g_i,g_p); + return; case ACTOR_PICNUM: if (iSet) + { sprite[iActor].picnum=lValue; - else - SetGameVarID(lVar2, sprite[iActor].picnum,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].picnum,g_i,g_p); + return; case ACTOR_SHADE: if (iSet) + { sprite[iActor].shade=lValue; - else - SetGameVarID(lVar2, sprite[iActor].shade,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].shade,g_i,g_p); + return; case ACTOR_PAL: if (iSet) + { sprite[iActor].pal=lValue; - else - SetGameVarID(lVar2, sprite[iActor].pal,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].pal,g_i,g_p); + return; case ACTOR_CLIPDIST: if (iSet) + { sprite[iActor].clipdist=lValue; - else - SetGameVarID(lVar2, sprite[iActor].clipdist,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].clipdist,g_i,g_p); + return; case ACTOR_DETAIL: if (iSet) + { sprite[iActor].filler=lValue; - else - SetGameVarID(lVar2, sprite[iActor].filler,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].filler,g_i,g_p); + return; case ACTOR_XREPEAT: if (iSet) + { sprite[iActor].xrepeat=lValue; - else - SetGameVarID(lVar2, sprite[iActor].xrepeat,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].xrepeat,g_i,g_p); + return; case ACTOR_YREPEAT: if (iSet) + { sprite[iActor].yrepeat=lValue; - else - SetGameVarID(lVar2, sprite[iActor].yrepeat,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].yrepeat,g_i,g_p); + return; case ACTOR_XOFFSET: if (iSet) + { sprite[iActor].xoffset=lValue; - else - SetGameVarID(lVar2, sprite[iActor].xoffset,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].xoffset,g_i,g_p); + return; case ACTOR_YOFFSET: if (iSet) + { sprite[iActor].yoffset=lValue; - else - SetGameVarID(lVar2, sprite[iActor].yoffset,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].yoffset,g_i,g_p); + return; case ACTOR_SECTNUM: if (iSet) + { changespritesect(iActor,lValue); - else - SetGameVarID(lVar2, sprite[iActor].sectnum,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].sectnum,g_i,g_p); + return; case ACTOR_STATNUM: if (iSet) + { changespritestat(iActor,lValue); - else - SetGameVarID(lVar2, sprite[iActor].statnum,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].statnum,g_i,g_p); + return; case ACTOR_ANG: if (iSet) + { sprite[iActor].ang=lValue; - else - SetGameVarID(lVar2, sprite[iActor].ang,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].ang,g_i,g_p); + return; case ACTOR_OWNER: if (iSet) + { sprite[iActor].owner=lValue; - else - SetGameVarID(lVar2, sprite[iActor].owner,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].owner,g_i,g_p); + return; case ACTOR_XVEL: if (iSet) + { sprite[iActor].xvel=lValue; - else - SetGameVarID(lVar2, sprite[iActor].xvel,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].xvel,g_i,g_p); + return; case ACTOR_YVEL: if (iSet) + { sprite[iActor].yvel=lValue; - else - SetGameVarID(lVar2, sprite[iActor].yvel,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].yvel,g_i,g_p); + return; case ACTOR_ZVEL: if (iSet) + { sprite[iActor].zvel=lValue; - else - SetGameVarID(lVar2, sprite[iActor].zvel,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].zvel,g_i,g_p); + return; case ACTOR_LOTAG: if (iSet) + { sprite[iActor].lotag=lValue; - else - SetGameVarID(lVar2, sprite[iActor].lotag,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].lotag,g_i,g_p); + return; case ACTOR_HITAG: if (iSet) + { sprite[iActor].hitag=lValue; - else - SetGameVarID(lVar2, sprite[iActor].hitag,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].hitag,g_i,g_p); + return; case ACTOR_EXTRA: if (iSet) + { sprite[iActor].extra=lValue; - else - SetGameVarID(lVar2, sprite[iActor].extra,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, sprite[iActor].extra,g_i,g_p); + return; case ACTOR_HTCGG: if (iSet) + { hittype[iActor].cgg=lValue; - else - SetGameVarID(lVar2, hittype[iActor].cgg, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[iActor].cgg, g_i, g_p); + return; case ACTOR_HTPICNUM : if (iSet) + { hittype[iActor].picnum=lValue; - else - SetGameVarID(lVar2, hittype[iActor].picnum, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[iActor].picnum, g_i, g_p); + return; case ACTOR_HTANG: if (iSet) + { hittype[iActor].ang=lValue; - else - SetGameVarID(lVar2, hittype[iActor].ang, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[iActor].ang, g_i, g_p); + return; case ACTOR_HTEXTRA: if (iSet) + { hittype[iActor].extra=lValue; - else - SetGameVarID(lVar2,hittype[iActor].extra, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].extra, g_i, g_p); + return; case ACTOR_HTOWNER: if (iSet) + { hittype[iActor].owner=lValue; - else - SetGameVarID(lVar2,hittype[iActor].owner, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].owner, g_i, g_p); + return; case ACTOR_HTMOVFLAG: if (iSet) + { hittype[iActor].movflag=lValue; - else - SetGameVarID(lVar2,hittype[iActor].movflag, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].movflag, g_i, g_p); + return; case ACTOR_HTTEMPANG: if (iSet) + { hittype[iActor].tempang=lValue; - else - SetGameVarID(lVar2,hittype[iActor].tempang, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].tempang, g_i, g_p); + return; case ACTOR_HTACTORSTAYPUT: if (iSet) + { hittype[iActor].actorstayput=lValue; - else - SetGameVarID(lVar2,hittype[iActor].actorstayput, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].actorstayput, g_i, g_p); + return; case ACTOR_HTDISPICNUM: if (iSet) + { hittype[iActor].dispicnum=lValue; - else - SetGameVarID(lVar2,hittype[iActor].dispicnum, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].dispicnum, g_i, g_p); + return; case ACTOR_HTTIMETOSLEEP: if (iSet) + { hittype[iActor].timetosleep=lValue; - else - SetGameVarID(lVar2,hittype[iActor].timetosleep, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].timetosleep, g_i, g_p); + return; case ACTOR_HTFLOORZ: if (iSet) + { hittype[iActor].floorz=lValue; - else - SetGameVarID(lVar2,hittype[iActor].floorz, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].floorz, g_i, g_p); + return; case ACTOR_HTCEILINGZ: if (iSet) + { hittype[iActor].ceilingz=lValue; - else - SetGameVarID(lVar2,hittype[iActor].ceilingz, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].ceilingz, g_i, g_p); + return; case ACTOR_HTLASTVX: if (iSet) + { hittype[iActor].lastvx=lValue; - else - SetGameVarID(lVar2,hittype[iActor].lastvx, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].lastvx, g_i, g_p); + return; case ACTOR_HTLASTVY: if (iSet) + { hittype[iActor].lastvy=lValue; - else - SetGameVarID(lVar2,hittype[iActor].lastvy, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].lastvy, g_i, g_p); + return; case ACTOR_HTBPOSX: if (iSet) + { hittype[iActor].bposx=lValue; - else - SetGameVarID(lVar2,hittype[iActor].bposx, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].bposx, g_i, g_p); + return; case ACTOR_HTBPOSY: if (iSet) + { hittype[iActor].bposy=lValue; - else - SetGameVarID(lVar2,hittype[iActor].bposy, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].bposy, g_i, g_p); + return; case ACTOR_HTBPOSZ: if (iSet) + { hittype[iActor].bposz=lValue; - else - SetGameVarID(lVar2,hittype[iActor].bposz, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,hittype[iActor].bposz, g_i, g_p); + return; case ACTOR_HTG_T: lTemp=lParm2; if (iSet) + { hittype[iActor].temp_data[lTemp]=lValue; - else - SetGameVarID(lVar2, hittype[iActor].temp_data[lTemp], g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, hittype[iActor].temp_data[lTemp], g_i, g_p); + return; case ACTOR_ANGOFF: if (iSet) + { spriteext[iActor].angoff=lValue; - else - SetGameVarID(lVar2,spriteext[iActor].angoff, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,spriteext[iActor].angoff, g_i, g_p); + return; case ACTOR_PITCH: if (iSet) + { spriteext[iActor].pitch=lValue; - else - SetGameVarID(lVar2,spriteext[iActor].pitch, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,spriteext[iActor].pitch, g_i, g_p); + return; case ACTOR_ROLL: if (iSet) + { spriteext[iActor].roll=lValue; - else - SetGameVarID(lVar2,spriteext[iActor].roll, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,spriteext[iActor].roll, g_i, g_p); + return; case ACTOR_MDXOFF: if (iSet) + { spriteext[iActor].xoff=lValue; - else - SetGameVarID(lVar2,spriteext[iActor].xoff, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,spriteext[iActor].xoff, g_i, g_p); + return; case ACTOR_MDYOFF: if (iSet) + { spriteext[iActor].yoff=lValue; - else - SetGameVarID(lVar2,spriteext[iActor].yoff, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,spriteext[iActor].yoff, g_i, g_p); + return; case ACTOR_MDZOFF: if (iSet) + { spriteext[iActor].zoff=lValue; - else - SetGameVarID(lVar2,spriteext[iActor].zoff, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,spriteext[iActor].zoff, g_i, g_p); + return; case ACTOR_MDFLAGS: if (iSet) + { spriteext[iActor].flags=lValue; - else - SetGameVarID(lVar2,spriteext[iActor].flags, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2,spriteext[iActor].flags, g_i, g_p); + return; case ACTOR_XPANNING: if (iSet) + { spriteext[iActor].xpanning=lValue; - else - SetGameVarID(lVar2, spriteext[iActor].xpanning,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, spriteext[iActor].xpanning,g_i,g_p); + return; case ACTOR_YPANNING: if (iSet) + { spriteext[iActor].ypanning=lValue; - else - SetGameVarID(lVar2, spriteext[iActor].ypanning,g_i,g_p); - break; + return; + } + SetGameVarID(lVar2, spriteext[iActor].ypanning,g_i,g_p); + return; default: - break; + return; } - return; } static void DoProjectile(int iSet, int lVar1, int lLabelID, int lVar2) @@ -2759,8 +3447,7 @@ static void DoProjectile(int iSet, int lVar1, int lLabelID, int lVar2) if (lVar1 < 0 || lVar1 >= MAXTILES) { OSD_Printf("DoProjectile(): invalid tile (%d)\n",lVar1); - if (lVar2 == MAXGAMEVARS) - insptr++; + insptr += (lVar2 == MAXGAMEVARS); return; } @@ -2770,204 +3457,259 @@ static void DoProjectile(int iSet, int lVar1, int lLabelID, int lVar2) { case PROJ_WORKSLIKE: if (iSet) + { projectile[lVar1].workslike=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].workslike, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].workslike, g_i, g_p); + return; case PROJ_SPAWNS: if (iSet) + { projectile[lVar1].spawns=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].spawns, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].spawns, g_i, g_p); + return; case PROJ_SXREPEAT: if (iSet) + { projectile[lVar1].sxrepeat=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].sxrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].sxrepeat, g_i, g_p); + return; case PROJ_SYREPEAT: if (iSet) + { projectile[lVar1].syrepeat=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].syrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].syrepeat, g_i, g_p); + return; case PROJ_SOUND: if (iSet) + { projectile[lVar1].sound=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].sound, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].sound, g_i, g_p); + return; case PROJ_ISOUND: if (iSet) + { projectile[lVar1].isound=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].isound, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].isound, g_i, g_p); + return; case PROJ_VEL: if (iSet) + { projectile[lVar1].vel=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].vel, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].vel, g_i, g_p); + return; case PROJ_EXTRA: if (iSet) + { projectile[lVar1].extra=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].extra, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].extra, g_i, g_p); + return; case PROJ_DECAL: if (iSet) + { projectile[lVar1].decal=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].decal, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].decal, g_i, g_p); + return; case PROJ_TRAIL: if (iSet) + { projectile[lVar1].trail=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].trail, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].trail, g_i, g_p); + return; case PROJ_TXREPEAT: if (iSet) + { projectile[lVar1].txrepeat=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].txrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].txrepeat, g_i, g_p); + return; case PROJ_TYREPEAT: if (iSet) + { projectile[lVar1].tyrepeat=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].tyrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].tyrepeat, g_i, g_p); + return; case PROJ_TOFFSET: if (iSet) + { projectile[lVar1].toffset=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].toffset, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].toffset, g_i, g_p); + return; case PROJ_TNUM: if (iSet) + { projectile[lVar1].tnum=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].tnum, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].tnum, g_i, g_p); + return; case PROJ_DROP: if (iSet) + { projectile[lVar1].drop=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].drop, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].drop, g_i, g_p); + return; case PROJ_CSTAT: if (iSet) + { projectile[lVar1].cstat=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].cstat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].cstat, g_i, g_p); + return; case PROJ_CLIPDIST: if (iSet) + { projectile[lVar1].clipdist=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].clipdist, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].clipdist, g_i, g_p); + return; case PROJ_SHADE: if (iSet) + { projectile[lVar1].shade=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].shade, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].shade, g_i, g_p); + return; case PROJ_XREPEAT: if (iSet) + { projectile[lVar1].xrepeat=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].xrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].xrepeat, g_i, g_p); + return; case PROJ_YREPEAT: if (iSet) + { projectile[lVar1].yrepeat=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].yrepeat, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].yrepeat, g_i, g_p); + return; case PROJ_PAL: if (iSet) + { projectile[lVar1].pal=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].pal, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].pal, g_i, g_p); + return; case PROJ_EXTRA_RAND: if (iSet) + { projectile[lVar1].extra_rand=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].extra_rand, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].extra_rand, g_i, g_p); + return; case PROJ_HITRADIUS: if (iSet) + { projectile[lVar1].hitradius=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].hitradius, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].hitradius, g_i, g_p); + return; case PROJ_VEL_MULT: if (iSet) + { projectile[lVar1].velmult=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].velmult, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].velmult, g_i, g_p); + return; case PROJ_OFFSET: if (iSet) + { projectile[lVar1].offset=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].offset, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].offset, g_i, g_p); + return; case PROJ_BOUNCES: if (iSet) + { projectile[lVar1].bounces=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].bounces, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].bounces, g_i, g_p); + return; case PROJ_BSOUND: if (iSet) + { projectile[lVar1].bsound=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].bsound, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].bsound, g_i, g_p); + return; case PROJ_RANGE: if (iSet) + { projectile[lVar1].range=lValue; - else - SetGameVarID(lVar2, projectile[lVar1].range, g_i, g_p); - break; + return; + } + SetGameVarID(lVar2, projectile[lVar1].range, g_i, g_p); + return; default: - break; + return; } - return; } static int parse(void); @@ -3527,24 +4269,22 @@ static void move(void) } } -static void parseifelse(int condition) +static inline void parseifelse(int condition) { if (condition) { // skip 'else' pointer.. and... insptr+=2; parse(); + return; } - else + insptr = (int *) *(insptr+1); + if (*insptr == CON_ELSE) { - insptr = (int *) *(insptr+1); - if (*insptr == 10) - { - // else... - // skip 'else' and... - insptr+=2; - parse(); - } + // else... + // skip 'else' and... + insptr+=2; + parse(); } } @@ -3552,7 +4292,7 @@ static void parseifelse(int condition) static int parse(void) { - int j, l, s, tw; + int j, l, s, tw = *insptr; if (killit_flag) return 1; @@ -3560,8 +4300,6 @@ static int parse(void) // Bsprintf(g_szBuf,"Parsing: %d",*insptr); // AddLog(g_szBuf); - tw = *insptr; - switch (tw) { case CON_REDEFINEQUOTE: @@ -5160,9 +5898,11 @@ static int parse(void) Bstrcpy(tempbuf,asctime(localtime(&curtime))); clearbuf(ud.savegame[lastsavedpos],sizeof(ud.savegame[lastsavedpos]),0); Bsprintf(ud.savegame[lastsavedpos],"Auto"); - for (j=0;j<13;j++) - Bmemcpy(&ud.savegame[lastsavedpos][j+4],&tempbuf[j+3],sizeof(tempbuf[j+3])); - ud.savegame[lastsavedpos][j+4] = '\0'; +// for (j=0;j<13;j++) +// Bmemcpy(&ud.savegame[lastsavedpos][j+4],&tempbuf[j+3],sizeof(tempbuf[j+3])); +// ud.savegame[lastsavedpos][j+4] = '\0'; + Bmemcpy(&ud.savegame[lastsavedpos][4],&tempbuf[3],sizeof(tempbuf[0])*13); + ud.savegame[lastsavedpos][17] = '\0'; OSD_Printf("Saving to slot %d\n",lastsavedpos); KB_FlushKeyboardQueue();