mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
parent
6018213c71
commit
9645009b28
3 changed files with 11 additions and 6 deletions
|
@ -435,12 +435,6 @@ CCMD(map)
|
||||||
auto map = FindMapByName(mapname);
|
auto map = FindMapByName(mapname);
|
||||||
if (map == nullptr)
|
if (map == nullptr)
|
||||||
{
|
{
|
||||||
// got a user map
|
|
||||||
if (g_gameType & GAMEFLAG_SHAREWARE)
|
|
||||||
{
|
|
||||||
Printf(PRINT_BOLD, "Cannot use user maps in shareware.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
map = SetupUserMap(mapfilename, g_gameType & GAMEFLAG_DUKE? "dethtoll.mid" : nullptr);
|
map = SetupUserMap(mapfilename, g_gameType & GAMEFLAG_DUKE? "dethtoll.mid" : nullptr);
|
||||||
}
|
}
|
||||||
if (map)
|
if (map)
|
||||||
|
|
|
@ -681,6 +681,10 @@ void MainLoop ()
|
||||||
if (userConfig.CommandMap.IsNotEmpty())
|
if (userConfig.CommandMap.IsNotEmpty())
|
||||||
{
|
{
|
||||||
auto maprecord = FindMapByName(userConfig.CommandMap);
|
auto maprecord = FindMapByName(userConfig.CommandMap);
|
||||||
|
if (maprecord == nullptr)
|
||||||
|
{
|
||||||
|
maprecord = SetupUserMap(userConfig.CommandMap, g_gameType & GAMEFLAG_DUKE? "dethtoll.mid" : nullptr);
|
||||||
|
}
|
||||||
userConfig.CommandMap = "";
|
userConfig.CommandMap = "";
|
||||||
if (maprecord)
|
if (maprecord)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include "raze_music.h"
|
#include "raze_music.h"
|
||||||
#include "filesystem.h"
|
#include "filesystem.h"
|
||||||
#include "printf.h"
|
#include "printf.h"
|
||||||
|
#include "gamecontrol.h"
|
||||||
#include "raze_sound.h"
|
#include "raze_sound.h"
|
||||||
|
|
||||||
FString gSkillNames[MAXSKILLS];
|
FString gSkillNames[MAXSKILLS];
|
||||||
|
@ -203,6 +204,12 @@ MapRecord *AllocateMap()
|
||||||
|
|
||||||
MapRecord* SetupUserMap(const char* boardfilename, const char *defaultmusic)
|
MapRecord* SetupUserMap(const char* boardfilename, const char *defaultmusic)
|
||||||
{
|
{
|
||||||
|
if (g_gameType & GAMEFLAG_SHAREWARE)
|
||||||
|
{
|
||||||
|
Printf(PRINT_BOLD, "Cannot use user maps in shareware.\n");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto& map : mapList)
|
for (auto& map : mapList)
|
||||||
{
|
{
|
||||||
if (map->fileName.CompareNoCase(boardfilename) == 0)
|
if (map->fileName.CompareNoCase(boardfilename) == 0)
|
||||||
|
|
Loading…
Reference in a new issue