diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index c720577c4..2ba7ea29e 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -57,15 +57,13 @@ static int osdcmd_map(CCmdFuncPtr parm) return CCMD_OK; } - for (int i = 0; i < 512; i++) + auto maprec = FindMapByName(mapname); + if (maprec) { - if (mapList[i].labelName.CompareNoCase(mapname) == 0) - { - int e = volfromlevelnum(mapList[i].levelNumber); - int m = mapfromlevelnum(mapList[i].levelNumber); - LevelWarp(e, m); - return CCMD_OK; - } + int e = volfromlevelnum(mapList[i].levelNumber); + int m = mapfromlevelnum(mapList[i].levelNumber); + LevelWarp(e, m); + return CCMD_OK; } // Map has not been defined. Treat as user map. diff --git a/source/sw/src/bunny.cpp b/source/sw/src/bunny.cpp index f92452efc..a74cc3740 100644 --- a/source/sw/src/bunny.cpp +++ b/source/sw/src/bunny.cpp @@ -1085,7 +1085,7 @@ DoBunnyQuickJump(short SpriteNum) NewStateGroup(SpriteNum, sg_BunnyScrew); NewStateGroup(hit_sprite, sg_BunnyScrew); - if (adult_lockout || Global_PLock) + if (adult_lockout) { SET(sp->cstat, CSTAT_SPRITE_INVISIBLE); // Turn em' invisible SET(tsp->cstat, CSTAT_SPRITE_INVISIBLE); // Turn em' invisible @@ -1476,7 +1476,7 @@ DoBunnyScrew(short SpriteNum) if (RANDOM_RANGE(1000) > 990) // Bunny sex sounds { - if (!adult_lockout && !Global_PLock) + if (!adult_lockout) PlaySound(DIGI_BUNNYATTACK, sp, v3df_follow); } diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index bdde79b53..148ddb213 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -601,7 +601,7 @@ analyzesprites(int viewx, int viewy, int viewz, SWBOOL mirror) } // Diss any parentally locked sprites - if (adult_lockout || Global_PLock) + if (adult_lockout) { if (aVoxelArray[tsp->picnum].Parental == 6145) { diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 311604a10..1b664dd92 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -91,33 +91,14 @@ CVAR(Bool, sw_darts, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); BEGIN_SW_NS void pClearSpriteList(PLAYERp pp); -signed char MNU_InputSmallString(char*, short); -signed char MNU_InputString(char*, short); -SWBOOL IsCommand(const char* str); extern SWBOOL mapcheat; extern SWBOOL MultiPlayQuitFlag; extern int sw_snd_scratch; - -#if DEBUG -#define BETA 0 -#endif - -#define PAL_SIZE (256*3) - char DemoName[15][16]; -// Stupid WallMart version! -//#define PLOCK_VERSION TRUE - -#if PLOCK_VERSION -SWBOOL Global_PLock = TRUE; -#else -SWBOOL Global_PLock = FALSE; -#endif - int GameVersion = 20; char DemoText[3][64]; @@ -231,7 +212,7 @@ SWBOOL InGame = FALSE; SWBOOL CommandSetup = FALSE; -char UserMapName[80]="", buffer[80], ch; +char buffer[80], ch; char LevelName[20]; uint8_t DebugPrintColor = 255; @@ -458,19 +439,9 @@ bool InitGame() videoInit(); - // precache as much stuff as you can - if (UserMapName[0] == '\0') - { - if (!LoadLevel("$dozer.map")) return false; - SetupPreCache(); - DoTheCache(); - } - else - { - if (!LoadLevel(UserMapName)) return false; - SetupPreCache(); - DoTheCache(); - } + if (!LoadLevel("$dozer.map")) return false; + SetupPreCache(); + DoTheCache(); GraphicsMode = TRUE; @@ -505,23 +476,6 @@ void InitNewGame(void) memset(puser, 0, sizeof(puser)); } -void FindLevelInfo(char *map_name, short *level) -{ - short j; - - for (j = 1; j <= MAX_LEVELS; j++) - { - if (Bstrcasecmp(map_name, mapList[j].fileName.GetChars()) == 0) - { - *level = j; - return; - } - } - - *level = 0; - return; -} - int ChopTics; void InitLevelGlobals(void) { @@ -594,24 +548,7 @@ InitLevel(void) if (Level > MAX_LEVELS) Level = 1; - if (UserMapName[0]) - { - strcpy(LevelName, UserMapName); - - Level = 0; - FindLevelInfo(UserMapName, &Level); - - if (Level > 0) - { - // user map is part of game - treat it as such - strcpy(LevelName, mapList[Level].fileName); - UserMapName[0] = '\0'; - } - } - else - { - strcpy(LevelName, mapList[Level].fileName); - } + strcpy(LevelName, mapList[Level].fileName); } if (NewGame) @@ -1007,9 +944,6 @@ void StatScreen(PLAYERp mpp) void GameIntro(void) { - if ((!CommEnabled && UserMapName[0])) - return; - Level = 1; Logo([](bool) { gamestate = GS_LEVEL; }); SyncScreenJob(); @@ -1363,8 +1297,6 @@ int32_t GameInterface::app_main() if (sw_snd_scratch == 0) // This is always 0 at this point - this check is only here to prevent whole program optimization from eliminating the variable. Printf("Copyright (c) 1997 3D Realms Entertainment\n"); - UserMapName[0] = '\0'; - registerosdcommands(); Control(); @@ -1489,7 +1421,7 @@ FunctionKeys(PLAYERp pp) if (inputState.AltPressed()) { - if (rts_delay > 16 && fn_key && !adult_lockout && !Global_PLock) + if (rts_delay > 16 && fn_key && !adult_lockout) { inputState.ClearKeyStatus(sc_F1 + fn_key - 1); rts_delay = 0; diff --git a/source/sw/src/game.h b/source/sw/src/game.h index bf466191e..e436aa9d2 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -776,7 +776,6 @@ typedef enum {WATER_FOOT, BLOOD_FOOT} FOOT_TYPE; extern FOOT_TYPE FootMode; extern SWBOOL InGame; // Declared in game.c -extern SWBOOL Global_PLock; // Game.c int QueueFloorBlood(short hit_sprite); // Weapon.c int QueueFootPrint(short hit_sprite); // Weapon.c int QueueGeneric(short SpriteNum, short pic); // Weapon.c diff --git a/source/sw/src/panel.cpp b/source/sw/src/panel.cpp index c8c4ba45f..124c47c6e 100644 --- a/source/sw/src/panel.cpp +++ b/source/sw/src/panel.cpp @@ -6775,7 +6775,7 @@ pDisplaySprites(PLAYERp pp) break; } - if (pp->Bloody && !adult_lockout && !Global_PLock) + if (pp->Bloody && !adult_lockout) { switch (picnum) { diff --git a/source/sw/src/save.cpp b/source/sw/src/save.cpp index 495d76c47..f20397ee2 100644 --- a/source/sw/src/save.cpp +++ b/source/sw/src/save.cpp @@ -68,7 +68,6 @@ TO DO */ extern int lastUpdate; -extern char UserMapName[80]; extern char SaveGameDescr[10][80]; extern int PlayClock; extern short Bunny_Count; @@ -646,7 +645,6 @@ bool GameInterface::SaveGame(FSaveGameNode *sv) MWRITE(&Bunny_Count,sizeof(Bunny_Count),1,fil); - MWRITE(UserMapName,sizeof(UserMapName),1,fil); MWRITE(&GodMode,sizeof(GodMode),1,fil); MWRITE(&FinishTimer,sizeof(FinishTimer),1,fil); @@ -1035,7 +1033,6 @@ bool GameInterface::LoadGame(FSaveGameNode* sv) MREAD(&Bunny_Count,sizeof(Bunny_Count),1,fil); - MREAD(UserMapName,sizeof(UserMapName),1,fil); MREAD(&GodMode,sizeof(GodMode),1,fil); MREAD(&FinishTimer,sizeof(FinishTimer),1,fil); diff --git a/source/sw/src/sounds.cpp b/source/sw/src/sounds.cpp index 858a8f2c9..181666cfb 100644 --- a/source/sw/src/sounds.cpp +++ b/source/sw/src/sounds.cpp @@ -621,7 +621,7 @@ int _PlaySound(int num, SPRITEp sp, PLAYERp pp, vec3_t* pos, Voc3D_Flags flags, SPRITEp sps = sp; // Weed out parental lock sounds if PLock is active - if (adult_lockout || Global_PLock) + if (adult_lockout) { for (unsigned i = 0; i < sizeof(PLocked_Sounds); i++) { diff --git a/source/sw/src/sprite.cpp b/source/sw/src/sprite.cpp index 7621bc6aa..918706bce 100644 --- a/source/sw/src/sprite.cpp +++ b/source/sw/src/sprite.cpp @@ -5746,7 +5746,7 @@ KeyMain: // Say something witty if (pp == Player+myconnectindex && hud_messages) { - int cookie = (adult_lockout || Global_PLock)? STD_RANDOM_RANGE(10) : STD_RANDOM_RANGE(MAX_FORTUNES); + int cookie = (adult_lockout)? STD_RANDOM_RANGE(10) : STD_RANDOM_RANGE(MAX_FORTUNES); // print to the console, and the user quote display. FStringf msg("%s %s", GStrings("TXTS_FORTUNE"), quoteMgr.GetQuote(QUOTE_COOKIE + cookie)); Printf(TEXTCOLOR_SAPPHIRE "%s\n", msg.GetChars());