Clear last overworld position when switching profile

This commit is contained in:
Alayan-stk-2 2018-09-17 17:01:59 +02:00 committed by GitHub
parent 2e559aa391
commit 7bda2d097d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@
#include "io/utf_writer.hpp"
#include "io/xml_node.hpp"
#include "online/online_player_profile.hpp"
#include "race/race_manager.hpp"
#include "utils/log.hpp"
#include "utils/translation.hpp"
@ -468,10 +469,12 @@ PlayerProfile *PlayerManager::getPlayer(const irr::core::stringw &name)
*/
void PlayerManager::setCurrentPlayer(PlayerProfile *player)
{
if (m_current_player != player)
race_manager->clearKartLastPositionOnOverworld();
m_current_player = player;
if(m_current_player)
{
m_current_player->computeActive();
}
} // setCurrentPlayer