added removing buffs on player exit

This commit is contained in:
kamilprzyb 2020-10-22 11:39:11 +02:00 committed by Gent
parent c7006b46ed
commit de99522340

View File

@ -88,6 +88,16 @@ void PlayerManager::removePlayer(CNSocket* key) {
// if the player was in a lair, clean it up // if the player was in a lair, clean it up
ChunkManager::destroyInstanceIfEmpty(fromInstance); ChunkManager::destroyInstanceIfEmpty(fromInstance);
// remove player's buffs from the server
auto it = NPCManager::EggBuffs.begin();
while (it != NPCManager::EggBuffs.end()) {
if (it->first.first == key) {
it = NPCManager::EggBuffs.erase(it);
}
else
it++;
}
std::cout << players.size() << " players" << std::endl; std::cout << players.size() << " players" << std::endl;
} }