- Fixed P_CheckMapData allowed non-map lump names to pass resulting in a crash when actually trying to load the map.

This commit is contained in:
Braden Obrzut 2013-08-08 23:47:58 -04:00
commit bb494292c6
3 changed files with 50 additions and 16 deletions

View file

@ -51,6 +51,7 @@
#include "i_system.h"
#include "doomerrors.h"
#include "doomstat.h"
#include "gstrings.h"
#include "s_sound.h"
@ -343,22 +344,30 @@ CCMD (changemap)
if (argv.argc() > 1)
{
if (!P_CheckMapData(argv[1]))
try
{
Printf ("No map %s\n", argv[1]);
}
else
{
if (argv.argc() > 2)
if (!P_CheckMapData(argv[1]))
{
Net_WriteByte (DEM_CHANGEMAP2);
Net_WriteByte (atoi(argv[2]));
Printf ("No map %s\n", argv[1]);
}
else
{
Net_WriteByte (DEM_CHANGEMAP);
if (argv.argc() > 2)
{
Net_WriteByte (DEM_CHANGEMAP2);
Net_WriteByte (atoi(argv[2]));
}
else
{
Net_WriteByte (DEM_CHANGEMAP);
}
Net_WriteString (argv[1]);
}
Net_WriteString (argv[1]);
}
catch(CRecoverableError &error)
{
if (error.GetMessage())
Printf("%s", error.GetMessage());
}
}
else