From bf665961ccee34a18ff572adf5c0fdb112295064 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 1 Feb 2019 21:19:16 +0100 Subject: [PATCH] - moved KEYCONF_only CCMDs out of play files. --- src/c_console.h | 1 - src/d_event.h | 2 -- src/g_level.cpp | 2 +- src/gamedata/g_mapinfo.h | 1 - src/gamedata/keysections.cpp | 42 ++++++++++++++++++++++++++++++++++++ src/p_local.h | 5 ----- src/p_user.cpp | 40 ---------------------------------- 7 files changed, 43 insertions(+), 50 deletions(-) diff --git a/src/c_console.h b/src/c_console.h index 39c16c9bbb..17aaf5de73 100644 --- a/src/c_console.h +++ b/src/c_console.h @@ -51,7 +51,6 @@ constate_e; extern int PrintColors[PRINTLEVELS + 2]; extern constate_e ConsoleState; -extern int ConBottom; // Initialize the console void C_InitConsole (int width, int height, bool ingame); diff --git a/src/d_event.h b/src/d_event.h index 302ef1aac2..4aeb4979c0 100644 --- a/src/d_event.h +++ b/src/d_event.h @@ -129,8 +129,6 @@ void D_Render(std::function action, bool interpolate); #define MAXEVENTS 128 extern event_t events[MAXEVENTS]; -extern int eventhead; -extern int eventtail; extern gameaction_t gameaction; diff --git a/src/g_level.cpp b/src/g_level.cpp index c2f61fbc42..dc3a7a48e2 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -571,7 +571,7 @@ EXTERN_CVAR(Bool, sv_singleplayerrespawn) void FLevelLocals::ChangeLevel(const char *levelname, int position, int flags, int nextSkill) { - if (this != currentUILevel) return; // only the primary level may exit. + if (!isPrimaryLevel()) return; // only the primary level may exit. FString nextlevel; level_info_t *nextinfo = nullptr; diff --git a/src/gamedata/g_mapinfo.h b/src/gamedata/g_mapinfo.h index e7e31deb24..775b5f6a07 100644 --- a/src/gamedata/g_mapinfo.h +++ b/src/gamedata/g_mapinfo.h @@ -438,7 +438,6 @@ struct cluster_info_t #define CLUSTER_ALLOWINTERMISSION 0x00000100 // Allow intermissions between levels in a hub. extern TArray wadlevelinfos; -extern TArray wadclusterinfos; // mapname will be changed if it is a valid warptrans bool CheckWarpTransMap (FString &mapname, bool substitute); diff --git a/src/gamedata/keysections.cpp b/src/gamedata/keysections.cpp index 29b6b53d50..7076ebbaaa 100644 --- a/src/gamedata/keysections.cpp +++ b/src/gamedata/keysections.cpp @@ -223,3 +223,45 @@ void D_LoadWadSettings () ParsingKeyConf = false; } +CCMD(clearplayerclasses) +{ + if (ParsingKeyConf) + { + PlayerClasses.Clear(); + } +} + +bool ValidatePlayerClass(PClassActor *ti, const char *name); + +CCMD(addplayerclass) +{ + if (ParsingKeyConf && argv.argc() > 1) + { + PClassActor *ti = PClass::FindActor(argv[1]); + + if (ValidatePlayerClass(ti, argv[1])) + { + FPlayerClass newclass; + + newclass.Type = ti; + newclass.Flags = 0; + + int arg = 2; + while (arg < argv.argc()) + { + if (!stricmp(argv[arg], "nomenu")) + { + newclass.Flags |= PCF_NOMENU; + } + else + { + Printf("Unknown flag '%s' for player class '%s'\n", argv[arg], argv[1]); + } + + arg++; + } + PlayerClasses.Push(newclass); + } + } +} + diff --git a/src/p_local.h b/src/p_local.h index e19581467b..93405dc08a 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -55,11 +55,6 @@ struct FLinePortal; #define STEEPSLOPE (46342/65536.) // [RH] Minimum floorplane.c value for walking -// Inspired by Maes -extern int bmapnegx; -extern int bmapnegy; - -//#define GRAVITY FRACUNIT #define MAXMOVE (30.) #define TALKRANGE (128.) diff --git a/src/p_user.cpp b/src/p_user.cpp index 9062957d82..dea310a8a1 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -239,46 +239,6 @@ void SetupPlayerClasses () } } -CCMD (clearplayerclasses) -{ - if (ParsingKeyConf) - { - PlayerClasses.Clear (); - } -} - -CCMD (addplayerclass) -{ - if (ParsingKeyConf && argv.argc () > 1) - { - PClassActor *ti = PClass::FindActor(argv[1]); - - if (ValidatePlayerClass(ti, argv[1])) - { - FPlayerClass newclass; - - newclass.Type = ti; - newclass.Flags = 0; - - int arg = 2; - while (arg < argv.argc()) - { - if (!stricmp (argv[arg], "nomenu")) - { - newclass.Flags |= PCF_NOMENU; - } - else - { - Printf ("Unknown flag '%s' for player class '%s'\n", argv[arg], argv[1]); - } - - arg++; - } - PlayerClasses.Push (newclass); - } - } -} - CCMD (playerclasses) { for (unsigned int i = 0; i < PlayerClasses.Size (); i++)