Move G_HaveUserMap to game.h, retitle it Menu_HaveUserMap, and add a proper G_HaveUserMap.

git-svn-id: https://svn.eduke32.com/eduke32@6615 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2018-01-29 11:13:21 +00:00
parent b25e48a1b3
commit 03fa42b17e
2 changed files with 16 additions and 11 deletions

View file

@ -279,6 +279,16 @@ extern const char *g_rtsNamePtr;
extern char boardfilename[BMAX_PATH], currentboardfilename[BMAX_PATH];
static inline int G_HaveUserMap(void)
{
return (boardfilename[0] != 0 && ud.level_number == 7 && ud.volume_number == 0);
}
static inline int Menu_HaveUserMap(void)
{
return (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0);
}
extern const char *defaultrtsfilename[GAMECOUNT];
extern const char *G_DefaultRtsFile(void);

View file

@ -1362,11 +1362,6 @@ static void prelevel(char g)
}
static inline int G_HaveUserMap(void)
{
return (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0);
}
void G_NewGame(int volumeNum, int levelNum, int skillNum)
{
DukePlayer_t *const pPlayer = g_player[0].ps;
@ -1402,7 +1397,7 @@ void G_NewGame(int volumeNum, int levelNum, int skillNum)
g_lastusersave.reset();
g_quickload = nullptr;
int const UserMap = G_HaveUserMap();
int const UserMap = Menu_HaveUserMap();
// we don't want the intro to play after the multiplayer setup screen
if ((!g_netServer && ud.multimode < 2) && UserMap == 0 &&
@ -1828,7 +1823,7 @@ int G_EnterLevel(int gameMode)
setgamemode(ud.config.ScreenMode, ud.config.ScreenWidth, ud.config.ScreenHeight, ud.config.ScreenBPP);
}
if (G_HaveUserMap())
if (Menu_HaveUserMap())
{
Bcorrectfilename(boardfilename,0);
@ -1852,7 +1847,7 @@ int G_EnterLevel(int gameMode)
if (g_mapInfo[mii].name == NULL || g_mapInfo[mii].filename == NULL)
{
if (G_HaveUserMap())
if (Menu_HaveUserMap())
{
if (g_mapInfo[mii].filename == NULL)
g_mapInfo[mii].filename = (char *)Xcalloc(BMAX_PATH, sizeof(uint8_t));
@ -1874,7 +1869,7 @@ int G_EnterLevel(int gameMode)
ud.screen_size = i;
if (G_HaveUserMap())
if (Menu_HaveUserMap())
{
if (g_gameNamePtr)
#ifdef EDUKE32_STANDALONE
@ -1902,7 +1897,7 @@ int G_EnterLevel(int gameMode)
DukePlayer_t *const pPlayer = g_player[0].ps;
if (!VOLUMEONE && G_HaveUserMap())
if (!VOLUMEONE && Menu_HaveUserMap())
{
if (loadboard(boardfilename, 0, &pPlayer->pos, &pPlayer->ang, &pPlayer->cursectnum) < 0)
{
@ -1934,7 +1929,7 @@ int G_EnterLevel(int gameMode)
G_AlignWarpElevators();
resetpspritevars(gameMode);
ud.playerbest = CONFIG_GetMapBestTime(G_HaveUserMap() ? boardfilename : g_mapInfo[mii].filename, g_loadedMapHack.md4);
ud.playerbest = CONFIG_GetMapBestTime(Menu_HaveUserMap() ? boardfilename : g_mapInfo[mii].filename, g_loadedMapHack.md4);
// G_FadeLoad(0,0,0, 252,0, -28, 4, -1);
G_CacheMapData();