diff options
author | n0n4m3 <none@none> | 2010-01-01 17:29:53 +0100 |
---|---|---|
committer | n0n4m3 <none@none> | 2010-01-01 17:29:53 +0100 |
commit | f497ae3ae07d3a5652bf3d6ddfbfedb2235affc9 (patch) | |
tree | da2e5fbec43de1bb54fc7606443114380663d6d6 /src/game/MiscHandler.cpp | |
parent | 70f452a838981ea09de05f022543a94d733c537b (diff) |
Fixed instance reset when high server uptime, thx Wowka321
--HG--
branch : trunk
Diffstat (limited to 'src/game/MiscHandler.cpp')
-rw-r--r-- | src/game/MiscHandler.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 2a9e3e49098..b3b847c9e97 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -1491,6 +1491,22 @@ void WorldSession::HandleSetDungeonDifficultyOpcode( WorldPacket & recv_data ) { if(pGroup->IsLeader(_player->GetGUID())) { + for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player* pGroupGuy = itr->getSource(); + if(!pGroupGuy) + continue; + + if(!pGroupGuy->IsInMap(pGroupGuy)) + return; + + map = pGroupGuy->GetMap(); + if(map && map->IsRaidOrHeroicDungeon()) + { + sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + return; + } + } // the difficulty is set even if the instances can't be reset //_player->SendDungeonDifficulty(true); pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player); @@ -1531,10 +1547,27 @@ void WorldSession::HandleSetRaidDifficultyOpcode( WorldPacket & recv_data ) if(_player->getLevel() < LEVELREQUIREMENT_HEROIC) return; - if(Group *pGroup = _player->GetGroup()) + Group *pGroup = _player->GetGroup(); + if(pGroup) { if(pGroup->IsLeader(_player->GetGUID())) { + for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player* pGroupGuy = itr->getSource(); + if(!pGroupGuy) + continue; + + if(!pGroupGuy->IsInMap(pGroupGuy)) + return; + + map = pGroupGuy->GetMap(); + if(map && map->IsRaidOrHeroicDungeon()) + { + sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + return; + } + } // the difficulty is set even if the instances can't be reset //_player->SendDungeonDifficulty(true); pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, true, _player); |