mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-11 03:19:46 +01:00
Add NULL guards to Game::savestats() and savesettings()
This is so those functions can safely be called when graphics.screenbuffer is NULL.
This commit is contained in:
parent
1f1b39a77a
commit
39e316828e
1 changed files with 10 additions and 0 deletions
|
@ -4708,6 +4708,11 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, ScreenSettings* s
|
||||||
|
|
||||||
bool Game::savestats()
|
bool Game::savestats()
|
||||||
{
|
{
|
||||||
|
if (graphics.screenbuffer == NULL)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ScreenSettings screen_settings;
|
ScreenSettings screen_settings;
|
||||||
graphics.screenbuffer->GetSettings(&screen_settings);
|
graphics.screenbuffer->GetSettings(&screen_settings);
|
||||||
|
|
||||||
|
@ -4950,6 +4955,11 @@ void Game::loadsettings(ScreenSettings* screen_settings)
|
||||||
|
|
||||||
bool Game::savesettings()
|
bool Game::savesettings()
|
||||||
{
|
{
|
||||||
|
if (graphics.screenbuffer == NULL)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ScreenSettings screen_settings;
|
ScreenSettings screen_settings;
|
||||||
graphics.screenbuffer->GetSettings(&screen_settings);
|
graphics.screenbuffer->GetSettings(&screen_settings);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue