[Core] Fix crash during gm .saveall
This commit is contained in:
parent
f8f4d90dcf
commit
03ea10a6b8
@ -105,10 +105,15 @@ Player* ObjectAccessor::FindPlayerByName(const char* name)
|
||||
void
|
||||
ObjectAccessor::SaveAllPlayers()
|
||||
{
|
||||
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
|
||||
HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
|
||||
for (HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{ itr->second->SaveToDB(); }
|
||||
SessionMap const& smap = sWorld.GetAllSessions();
|
||||
SessionMap::const_iterator iter;
|
||||
for (iter = smap.begin(); iter != smap.end(); ++iter){
|
||||
if (Player* player = iter->second->GetPlayer()){
|
||||
if (player->IsInWorld()){
|
||||
player->SaveToDB();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectAccessor::KickPlayer(ObjectGuid guid)
|
||||
|
@ -412,6 +412,8 @@ enum RealmZone
|
||||
REALM_ZONE_CN9 = 29 // basic-Latin at create, any at login
|
||||
};
|
||||
|
||||
typedef std::unordered_map<uint32, WorldSession*> SessionMap;
|
||||
|
||||
/// Storage class for commands issued for delayed execution
|
||||
struct CliCommandHolder
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user