mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-07 08:21:04 +00:00
- added a am_showalllines cheat CVAR as countermeasure for maps that intentionally disable the full automap.
SVN r2307 (trunk)
This commit is contained in:
parent
d070e04ff6
commit
1b0756e170
9 changed files with 59 additions and 12 deletions
|
@ -177,6 +177,45 @@ CVAR (Color, am_ovthingcolor_friend, 0xe88800, CVAR_ARCHIVE);
|
||||||
CVAR (Color, am_ovthingcolor_monster, 0xe88800, CVAR_ARCHIVE);
|
CVAR (Color, am_ovthingcolor_monster, 0xe88800, CVAR_ARCHIVE);
|
||||||
CVAR (Color, am_ovthingcolor_item, 0xe88800, CVAR_ARCHIVE);
|
CVAR (Color, am_ovthingcolor_item, 0xe88800, CVAR_ARCHIVE);
|
||||||
|
|
||||||
|
// Disable the ML_DONTDRAW line flag if x% of all lines in a map are flagged with it
|
||||||
|
// (To counter annoying mappers who think they are smart by making the automap unusable)
|
||||||
|
bool am_showallenabled;
|
||||||
|
|
||||||
|
CUSTOM_CVAR (Int, am_showalllines, -1, 0) // This is a cheat so don't save it.
|
||||||
|
{
|
||||||
|
int flagged = 0;
|
||||||
|
int total = 0;
|
||||||
|
if (self > 0)
|
||||||
|
{
|
||||||
|
for(int i=0;i<numlines;i++)
|
||||||
|
{
|
||||||
|
line_t *line = &lines[i];
|
||||||
|
|
||||||
|
// disregard intra-sector lines
|
||||||
|
if (line->frontsector == line->backsector) continue;
|
||||||
|
|
||||||
|
// disregard control sectors for deep water
|
||||||
|
if (line->frontsector->e->FakeFloor.Sectors.Size() > 0) continue;
|
||||||
|
|
||||||
|
// disregard control sectors for 3D-floors
|
||||||
|
if (line->frontsector->e->XFloor.attached.Size() > 0) continue;
|
||||||
|
|
||||||
|
total++;
|
||||||
|
if (line->flags & ML_DONTDRAW) flagged++;
|
||||||
|
}
|
||||||
|
am_showallenabled = (flagged * 100 / total >= self);
|
||||||
|
}
|
||||||
|
else if (self == 0)
|
||||||
|
{
|
||||||
|
am_showallenabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
am_showallenabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// drawing stuff
|
// drawing stuff
|
||||||
#define AM_PANDOWNKEY KEY_DOWNARROW
|
#define AM_PANDOWNKEY KEY_DOWNARROW
|
||||||
#define AM_PANUPKEY KEY_UPARROW
|
#define AM_PANUPKEY KEY_UPARROW
|
||||||
|
@ -946,6 +985,8 @@ void AM_LevelInit ()
|
||||||
if (scale_mtof > max_scale_mtof)
|
if (scale_mtof > max_scale_mtof)
|
||||||
scale_mtof = min_scale_mtof;
|
scale_mtof = min_scale_mtof;
|
||||||
scale_ftom = MapDiv(MAPUNIT, scale_mtof);
|
scale_ftom = MapDiv(MAPUNIT, scale_mtof);
|
||||||
|
|
||||||
|
am_showalllines.Callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -1601,7 +1642,12 @@ void AM_drawWalls (bool allmap)
|
||||||
if (am_cheat != 0 || (lines[i].flags & ML_MAPPED))
|
if (am_cheat != 0 || (lines[i].flags & ML_MAPPED))
|
||||||
{
|
{
|
||||||
if ((lines[i].flags & ML_DONTDRAW) && am_cheat == 0)
|
if ((lines[i].flags & ML_DONTDRAW) && am_cheat == 0)
|
||||||
continue;
|
{
|
||||||
|
if (!am_showallenabled || CheckCheatmode(false))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (AM_CheckSecret(&lines[i]))
|
if (AM_CheckSecret(&lines[i]))
|
||||||
{
|
{
|
||||||
|
@ -1680,8 +1726,14 @@ void AM_drawWalls (bool allmap)
|
||||||
}
|
}
|
||||||
else if (allmap)
|
else if (allmap)
|
||||||
{
|
{
|
||||||
if (!(lines[i].flags & ML_DONTDRAW))
|
if ((lines[i].flags & ML_DONTDRAW) && am_cheat == 0)
|
||||||
AM_drawMline(&l, NotSeenColor);
|
{
|
||||||
|
if (!am_showallenabled || CheckCheatmode(false))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AM_drawMline(&l, NotSeenColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,8 +67,6 @@ CCMD (removebots)
|
||||||
Net_WriteByte (DEM_KILLBOTS);
|
Net_WriteByte (DEM_KILLBOTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool CheckCheatmode ();
|
|
||||||
|
|
||||||
CCMD (freeze)
|
CCMD (freeze)
|
||||||
{
|
{
|
||||||
if (CheckCheatmode ())
|
if (CheckCheatmode ())
|
||||||
|
|
|
@ -80,11 +80,11 @@ CCMD (toggleconsole)
|
||||||
C_ToggleConsole();
|
C_ToggleConsole();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckCheatmode ()
|
bool CheckCheatmode (bool printmsg)
|
||||||
{
|
{
|
||||||
if ((G_SkillProperty(SKILLP_DisableCheats) || netgame || deathmatch) && (!sv_cheats))
|
if ((G_SkillProperty(SKILLP_DisableCheats) || netgame || deathmatch) && (!sv_cheats))
|
||||||
{
|
{
|
||||||
Printf ("sv_cheats must be true to enable this command.\n");
|
if (printmsg) Printf ("sv_cheats must be true to enable this command.\n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
class FConfigFile;
|
class FConfigFile;
|
||||||
class APlayerPawn;
|
class APlayerPawn;
|
||||||
|
|
||||||
|
extern bool CheckCheatmode (bool printmsg = true);
|
||||||
|
|
||||||
void C_ExecCmdLineParams ();
|
void C_ExecCmdLineParams ();
|
||||||
|
|
||||||
// Add commands to the console as if they were typed in. Can handle wait
|
// Add commands to the console as if they were typed in. Can handle wait
|
||||||
|
|
|
@ -120,7 +120,6 @@ extern void M_SetDefaultMode ();
|
||||||
extern void R_ExecuteSetViewSize ();
|
extern void R_ExecuteSetViewSize ();
|
||||||
extern void G_NewInit ();
|
extern void G_NewInit ();
|
||||||
extern void SetupPlayerClasses ();
|
extern void SetupPlayerClasses ();
|
||||||
extern bool CheckCheatmode ();
|
|
||||||
const IWADInfo *D_FindIWAD(TArray<FString> &wadfiles, const char *iwad, const char *basewad);
|
const IWADInfo *D_FindIWAD(TArray<FString> &wadfiles, const char *iwad, const char *basewad);
|
||||||
|
|
||||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||||
|
|
|
@ -454,7 +454,6 @@ CCMD (dumpmapthings)
|
||||||
FDoomEdMap::DumpMapThings ();
|
FDoomEdMap::DumpMapThings ();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckCheatmode ();
|
|
||||||
|
|
||||||
static void SummonActor (int command, int command2, FCommandLine argv)
|
static void SummonActor (int command, int command2, FCommandLine argv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1062,7 +1062,6 @@ void cht_Suicide (player_t *plyr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckCheatmode ();
|
|
||||||
|
|
||||||
CCMD (mdk)
|
CCMD (mdk)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1539,7 +1539,6 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckCheatmode ();
|
|
||||||
|
|
||||||
CCMD (kill)
|
CCMD (kill)
|
||||||
{
|
{
|
||||||
|
|
|
@ -293,7 +293,6 @@ static cheatseq_t SpecialCheats[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern bool CheckCheatmode ();
|
|
||||||
|
|
||||||
CVAR(Bool, allcheats, false, CVAR_ARCHIVE)
|
CVAR(Bool, allcheats, false, CVAR_ARCHIVE)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue