Skip to content

Commit

Permalink
minor styling fix
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1arm committed Jul 1, 2022
1 parent c0cdae1 commit c5e3d88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/game/Object/ObjectAccessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ void ObjectAccessor::SaveAllPlayers()
{
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()){
for (iter = smap.begin(); iter != smap.end(); ++iter)
{
if (Player* player = iter->second->GetPlayer())
{
if (player->IsInWorld())
{
player->SaveToDB();
}
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/game/Object/ObjectAccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,12 @@ class ObjectAccessor : public MaNGOS::Singleton<ObjectAccessor, MaNGOS::ClassLev
{
ACE_READ_GUARD(HashMapHolder<Player>::LockType, g, i_playerMap.GetLock())
for (auto& iter : i_playerMap.GetContainer())
{
if(iter.second != nullptr)
{
std::forward<F>(f)(iter.second);
}
}
}

private:
Expand Down

0 comments on commit c5e3d88

Please sign in to comment.