mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Fixed a bug with setting the reset schedul when removing players from the map
This commit is contained in:
parent
d922ea27b9
commit
316acd590c
1 changed files with 4 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue