mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Don't let custom levels tamper with main game save data
Someone being mean could've overwritten the telesaves of unsuspecting players, or unlocked a bunch of stuff which they shouldn't have for those players, using things like the telesave() command and gamestates. To prevent this, return early in Game::savequick(), Game::savetele(), and Game::unlocknum() if we are in custommode.
This commit is contained in:
parent
cad0b4fcc4
commit
cfd355bf4d
1 changed files with 18 additions and 0 deletions
|
@ -4208,6 +4208,12 @@ void Game::deletestats( mapclass& map, Graphics& dwgfx )
|
|||
|
||||
void Game::unlocknum( int t, mapclass& map, Graphics& dwgfx )
|
||||
{
|
||||
if (map.custommode)
|
||||
{
|
||||
//Don't let custom levels unlock things!
|
||||
return;
|
||||
}
|
||||
|
||||
unlock[t] = true;
|
||||
savestats(map, dwgfx);
|
||||
}
|
||||
|
@ -5661,6 +5667,12 @@ void Game::savetele( mapclass& map, entityclass& obj, musicclass& music )
|
|||
//Save to the telesave cookie
|
||||
telecookieexists = true;
|
||||
|
||||
if (map.custommode)
|
||||
{
|
||||
//Don't trash save data!
|
||||
return;
|
||||
}
|
||||
|
||||
TiXmlDocument doc;
|
||||
TiXmlElement* msg;
|
||||
TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );
|
||||
|
@ -5904,6 +5916,12 @@ void Game::savequick( mapclass& map, entityclass& obj, musicclass& music )
|
|||
{
|
||||
quickcookieexists = true;
|
||||
|
||||
if (map.custommode)
|
||||
{
|
||||
//Don't trash save data!
|
||||
return;
|
||||
}
|
||||
|
||||
TiXmlDocument doc;
|
||||
TiXmlElement* msg;
|
||||
TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );
|
||||
|
|
Loading…
Reference in a new issue