- removed the non-functional user map handling.

This will have to be redone in a more flexible manner
This commit is contained in:
Christoph Oelckers 2020-08-16 11:42:13 +02:00
parent f9b953eeae
commit 90a4d0dcb8
9 changed files with 18 additions and 92 deletions

View file

@ -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.

View file

@ -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);
}

View file

@ -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)
{

View file

@ -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;

View file

@ -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

View file

@ -6775,7 +6775,7 @@ pDisplaySprites(PLAYERp pp)
break;
}
if (pp->Bloody && !adult_lockout && !Global_PLock)
if (pp->Bloody && !adult_lockout)
{
switch (picnum)
{

View file

@ -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);

View file

@ -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++)
{

View file

@ -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());