mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-25 13:55:36 -04:00
umapinfo: fix idclev (#318)
* umapinfo: fix idclev * set EpiCustom if episode > 4 * move EpiCustom and G_LookupMapinfo to u_mapinfo.h * fix clang build
This commit is contained in:
parent
fd8781bad6
commit
423ac8e20d
@ -77,8 +77,6 @@ static size_t maxdemosize;
|
||||
static byte *demo_p;
|
||||
static short consistancy[MAXPLAYERS][BACKUPTICS];
|
||||
|
||||
static mapentry_t *G_LookupMapinfo(int episode, int map);
|
||||
|
||||
static int G_GameOptionSize(void);
|
||||
|
||||
gameaction_t gameaction;
|
||||
@ -2623,7 +2621,7 @@ void G_SetFastParms(int fast_pending)
|
||||
}
|
||||
}
|
||||
|
||||
static mapentry_t *G_LookupMapinfo(int episode, int map)
|
||||
mapentry_t *G_LookupMapinfo(int episode, int map)
|
||||
{
|
||||
char lumpname[9];
|
||||
unsigned i;
|
||||
@ -2662,6 +2660,9 @@ int G_ValidateMapName(const char *mapname, int *pEpi, int *pMap)
|
||||
epi = 1;
|
||||
}
|
||||
|
||||
if (epi > 4)
|
||||
EpiCustom = true;
|
||||
|
||||
if (pEpi) *pEpi = epi;
|
||||
if (pMap) *pMap = map;
|
||||
return !strcmp(mapuname, lumpname);
|
||||
@ -2672,8 +2673,6 @@ int G_ValidateMapName(const char *mapname, int *pEpi, int *pMap)
|
||||
// Can be called by the startup code or the menu task,
|
||||
// consoleplayer, displayplayer, playeringame[] should be set.
|
||||
|
||||
extern int EpiCustom;
|
||||
|
||||
void G_InitNew(skill_t skill, int episode, int map)
|
||||
{
|
||||
int i;
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "dstrings.h"
|
||||
#include "d_deh.h" // Ty 03/27/98 - externalized strings
|
||||
#include "d_io.h" // haleyjd
|
||||
#include "u_mapinfo.h"
|
||||
|
||||
#define plyr (players+consoleplayer) /* the console player */
|
||||
|
||||
@ -438,6 +439,7 @@ static void cheat_clev(buf)
|
||||
char buf[3];
|
||||
{
|
||||
int epsd, map;
|
||||
mapentry_t* entry;
|
||||
|
||||
if (gamemode == commercial)
|
||||
{
|
||||
@ -450,6 +452,11 @@ char buf[3];
|
||||
map = buf[1] - '0';
|
||||
}
|
||||
|
||||
// First check if we have a mapinfo entry for the requested level.
|
||||
// If this is present the remaining checks should be skipped.
|
||||
entry = G_LookupMapinfo(epsd, map);
|
||||
if (!entry)
|
||||
{
|
||||
// Catch invalid maps.
|
||||
if (epsd < 1 || map < 1 || // Ohmygod - this is not going to work.
|
||||
(gamemode == retail && (epsd > 4 || map > 9 )) ||
|
||||
@ -457,6 +464,7 @@ char buf[3];
|
||||
(gamemode == shareware && (epsd > 1 || map > 9 )) ||
|
||||
(gamemode == commercial && (epsd > 1 || map > 32 )) )
|
||||
return;
|
||||
}
|
||||
|
||||
// So be it.
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
#ifndef __UMAPINFO_H
|
||||
#define __UMAPINFO_H
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int type;
|
||||
@ -60,6 +62,9 @@ typedef struct
|
||||
|
||||
extern umapinfo_t U_mapinfo;
|
||||
|
||||
extern boolean EpiCustom;
|
||||
mapentry_t *G_LookupMapinfo(int episode, int map);
|
||||
|
||||
int U_ParseMapInfo(const char *buffer, size_t length);
|
||||
void U_FreeMapInfo();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user