[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:
NoFantasy 2010-01-24 16:09:49 +01:00
parent 64bd59a11b
commit 2b3971ed26
3 changed files with 7 additions and 4 deletions

View file

@ -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;
}