mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
[9249] Move instance call OnPlayerEnter() to after really added to map
Also clarify log message and comment for function. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
64bd59a11b
commit
2b3971ed26
3 changed files with 7 additions and 4 deletions
|
|
@ -2464,12 +2464,11 @@ 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);
|
||||
|
||||
sLog.outDetail("MAP: Player '%s' entered the instance '%u' of map '%s'", player->GetName(), GetInstanceId(), GetMapName());
|
||||
sLog.outDetail("MAP: Player '%s' is entering instance '%u' of map '%s'", player->GetName(), GetInstanceId(), GetMapName());
|
||||
// initialize unload state
|
||||
m_unloadTimer = 0;
|
||||
m_resetAfterUnload = false;
|
||||
|
|
@ -2478,6 +2477,10 @@ bool InstanceMap::Add(Player *player)
|
|||
|
||||
// this will acquire the same mutex so it cannot be in the previous block
|
||||
Map::Add(player);
|
||||
|
||||
if (i_data)
|
||||
i_data->OnPlayerEnter(player);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue