@ -322,17 +322,19 @@ bool AiL::OnUserCreate(){
ValidateGameStatus ( ) ; //Checks to make sure everything has been initialized properly.
ValidateGameStatus ( ) ; //Checks to make sure everything has been initialized properly.
# ifndef __EMSCRIPTEN__
# ifndef __EMSCRIPTEN__
SetupDiscord ( ) ;
SetupDiscord ( ) ;
if ( SteamAPI_RestartAppIfNecessary ( 2895980U ) ) return false ; //Immediately quit if steam is detected and can be started through it.
if ( SteamAPI_Init ( ) ) {
if ( SteamAPI_Init ( ) ) {
std : : cout < < " Steam API Initialized successfully! " < < std : : endl ;
std : : cout < < " Steam API Initialized successfully! " < < std : : endl ;
} else {
} else {
std : : cout < < " Steam API failed to initialize! " < < std : : endl ;
std : : cout < < " Steam API failed to initialize! " < < std : : endl ;
}
}
if ( SteamAPI_IsSteamRunning ( ) ) {
if ( SteamUtils ( ) ! = nullptr )
SteamUtils ( ) - > SetWarningMessageHook ( [ ] ( int severity , const char * message ) {
SteamUtils ( ) - > SetWarningMessageHook ( [ ] ( int severity , const char * message ) {
std : : cout < < std : : format ( " STEAM[{}]: {} " , severity , std : : string ( message ) ) < < std : : endl ;
std : : cout < < std : : format ( " STEAM[{}]: {} " , severity , std : : string ( message ) ) < < std : : endl ;
} ) ;
} ) ;
if ( SteamInput ( ) ! = nullptr )
SteamInput ( ) - > Init ( false ) ;
SteamInput ( ) - > Init ( false ) ;
}
# endif
# endif
gameInitialized = true ;
gameInitialized = true ;
@ -2783,6 +2785,7 @@ bool AiL::IsReflectiveTile(TilesheetData tileSheet,int tileID){
}
}
bool AiL : : OnUserDestroy ( ) {
bool AiL : : OnUserDestroy ( ) {
SteamAPI_Shutdown ( ) ;
GFX . Reset ( ) ;
GFX . Reset ( ) ;
for ( auto & [ key , value ] : MAP_DATA ) {
for ( auto & [ key , value ] : MAP_DATA ) {
if ( MAP_DATA [ key ] . optimizedTile ! = nullptr ) {
if ( MAP_DATA [ key ] . optimizedTile ! = nullptr ) {