- moved KEYCONF_only CCMDs out of play files.

This commit is contained in:
Christoph Oelckers 2019-02-01 21:19:16 +01:00
parent 32e5be83ea
commit bf665961cc
7 changed files with 43 additions and 50 deletions

View file

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

View file

@ -129,8 +129,6 @@ void D_Render(std::function<void()> action, bool interpolate);
#define MAXEVENTS 128
extern event_t events[MAXEVENTS];
extern int eventhead;
extern int eventtail;
extern gameaction_t gameaction;

View file

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

View file

@ -438,7 +438,6 @@ struct cluster_info_t
#define CLUSTER_ALLOWINTERMISSION 0x00000100 // Allow intermissions between levels in a hub.
extern TArray<level_info_t> wadlevelinfos;
extern TArray<cluster_info_t> wadclusterinfos;
// mapname will be changed if it is a valid warptrans
bool CheckWarpTransMap (FString &mapname, bool substitute);

View file

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

View file

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

View file

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