diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 924901864..4da16004b 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -1625,6 +1625,8 @@ bool InstanceMap::Add(Player *player) } if(i_data) i_data->OnPlayerEnter(player); + // for normal instances cancel the reset schedule when the + // first player enters (no players yet) SetResetSchedule(false); player->SendInitWorldStates(); @@ -1651,11 +1653,12 @@ void InstanceMap::Update(const uint32& t_diff) void InstanceMap::Remove(Player *player, bool remove) { sLog.outDetail("MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to other map", player->GetName(), GetInstanceId(), GetMapName()); - SetResetSchedule(true); //if last player set unload timer if(!m_unloadTimer && m_mapRefManager.getSize() == 1) m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld.getConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY); Map::Remove(player, remove); + // for normal instances schedule the reset after all players have left + SetResetSchedule(true); } void InstanceMap::CreateInstanceData(bool load)