Merge branch 'master' of https://github.com/supertuxkart/stk-code
This commit is contained in:
commit
95483268cf
@ -170,7 +170,11 @@ PlayerManager::~PlayerManager()
|
||||
for_var_in(PlayerProfile*, player, m_all_players)
|
||||
{
|
||||
if(!player->rememberPassword())
|
||||
player->clearSession();
|
||||
{
|
||||
// Don't let the player trigger a save, since it
|
||||
// will be done below anyway.
|
||||
player->clearSession(/*save*/false);
|
||||
}
|
||||
}
|
||||
save();
|
||||
|
||||
|
@ -235,12 +235,13 @@ void PlayerProfile::saveSession(int user_id, const std::string &token)
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Unsets any saved session data. */
|
||||
void PlayerProfile::clearSession()
|
||||
void PlayerProfile::clearSession(bool save)
|
||||
{
|
||||
m_saved_session = false;
|
||||
m_saved_user_id = 0;
|
||||
m_saved_token = "";
|
||||
PlayerManager::get()->save();
|
||||
if(save)
|
||||
PlayerManager::get()->save();
|
||||
} // clearSession
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -121,7 +121,7 @@ public:
|
||||
bool operator<(const PlayerProfile &other);
|
||||
void raceFinished();
|
||||
void saveSession(int user_id, const std::string &token);
|
||||
void clearSession();
|
||||
void clearSession(bool save=true);
|
||||
void addIcon();
|
||||
|
||||
/** Abstract virtual classes, to be implemented by the OnlinePlayer. */
|
||||
|
@ -436,7 +436,7 @@ bool onEvent(const SEvent &event)
|
||||
else if (cmdID == DEBUG_HIDE_KARTS)
|
||||
{
|
||||
if (!world) return false;
|
||||
for (int n = 0; n<world->getNumKarts(); n++)
|
||||
for (unsigned int n = 0; n<world->getNumKarts(); n++)
|
||||
{
|
||||
AbstractKart* kart = world->getKart(n);
|
||||
if (kart->getController()->isPlayerController())
|
||||
|
Loading…
x
Reference in New Issue
Block a user