diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 91186c4d..d3024ad9 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -322,17 +322,19 @@ bool AiL::OnUserCreate(){ ValidateGameStatus(); //Checks to make sure everything has been initialized properly. #ifndef __EMSCRIPTEN__ SetupDiscord(); + if(SteamAPI_RestartAppIfNecessary(2895980U))return false; //Immediately quit if steam is detected and can be started through it. if(SteamAPI_Init()){ std::cout<<"Steam API Initialized successfully!"<SetWarningMessageHook([](int severity,const char*message){ std::cout<Init(false); - } + #endif gameInitialized=true; @@ -2783,6 +2785,7 @@ bool AiL::IsReflectiveTile(TilesheetData tileSheet,int tileID){ } bool AiL::OnUserDestroy(){ + SteamAPI_Shutdown(); GFX.Reset(); for(auto&[key,value]:MAP_DATA){ if(MAP_DATA[key].optimizedTile!=nullptr){ diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 21438e3f..9bde1622 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 5 #define VERSION_PATCH 1 -#define VERSION_BUILD 8221 +#define VERSION_BUILD 8224 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/olcPixelGameEngine.h b/Adventures in Lestoria/olcPixelGameEngine.h index 6ae98d71..91d6ddf5 100644 --- a/Adventures in Lestoria/olcPixelGameEngine.h +++ b/Adventures in Lestoria/olcPixelGameEngine.h @@ -4715,7 +4715,10 @@ namespace olc // Create user resources as part of this thread for (auto& ext : vExtensions) ext->OnBeforeUserCreate(); - if (!OnUserCreate()) bAtomActive = false; + if (!OnUserCreate()){ + bAtomActive = false; + OnUserDestroy(); + } for (auto& ext : vExtensions) ext->OnAfterUserCreate(); while (bAtomActive) diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index b488aed0..9c671771 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ