Save players.xml to avoid achievements gone when pressing home button in mobile stk

This commit is contained in:
Benau 2019-12-25 14:38:00 +08:00
parent 82cbf3b09f
commit f5f647c7ce
2 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#endif
#include "audio/music_manager.hpp"
#include "audio/sfx_manager.hpp"
#include "config/player_manager.hpp"
#include "config/user_config.hpp"
#include "graphics/irr_driver.hpp"
#include "graphics/stk_tex_manager.hpp"
@ -185,6 +186,7 @@ bool EventHandler::OnEvent (const SEvent &event)
music_manager->pauseMusic();
SFXManager::get()->pauseAll();
}
PlayerManager::get()->save();
if (addons_manager->hasDownloadedIcons())
addons_manager->saveInstalled();
}

View File

@ -24,6 +24,7 @@
#endif
#include "audio/music_manager.hpp"
#include "audio/sfx_manager.hpp"
#include "config/player_manager.hpp"
#include "config/user_config.hpp"
#include "graphics/central_settings.hpp"
#include "graphics/irr_driver.hpp"
@ -131,6 +132,7 @@ float MainLoop::getLimitedDt()
first_out_focus = false;
music_manager->pauseMusic();
SFXManager::get()->pauseAll();
PlayerManager::get()->save();
if (addons_manager->hasDownloadedIcons())
addons_manager->saveInstalled();
}