diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp index b9baa025a..5d2300676 100644 --- a/src/game/QuestHandler.cpp +++ b/src/game/QuestHandler.cpp @@ -429,60 +429,56 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) { CHECK_PACKET_SIZE(recvPacket,4); - uint32 quest; - recvPacket >> quest; + uint32 questId; + recvPacket >> questId; - sLog.outDebug( "WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", quest ); + sLog.outDebug("WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); - Quest const *pQuest = objmgr.GetQuestTemplate(quest); - if( pQuest ) + if (Quest const *pQuest = objmgr.GetQuestTemplate(questId)) { - if( _player->GetGroup() ) + if (Group* pGroup = _player->GetGroup()) { - Group *pGroup = _player->GetGroup(); - if( pGroup ) + for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { - for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + Player *pPlayer = itr->getSource(); + + if (!pPlayer || pPlayer == _player) // skip self + continue; + + _player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_SHARING_QUEST); + + if (!pPlayer->SatisfyQuestStatus(pQuest, false)) { - Player *pPlayer = itr->getSource(); - if (!pPlayer || pPlayer == _player) // skip self - continue; - - _player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_SHARING_QUEST); - - if( !pPlayer->SatisfyQuestStatus( pQuest, false ) ) - { - _player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_HAVE_QUEST ); - continue; - } - - if( pPlayer->GetQuestStatus( quest ) == QUEST_STATUS_COMPLETE ) - { - _player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_FINISH_QUEST ); - continue; - } - - if( !pPlayer->CanTakeQuest( pQuest, false ) ) - { - _player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_CANT_TAKE_QUEST ); - continue; - } - - if( !pPlayer->SatisfyQuestLog( false ) ) - { - _player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_LOG_FULL ); - continue; - } - - if( pPlayer->GetDivider() != 0 ) - { - _player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_BUSY ); - continue; - } - - pPlayer->PlayerTalkClass->SendQuestGiverQuestDetails( pQuest, _player->GetGUID(), true ); - pPlayer->SetDivider( _player->GetGUID() ); + _player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_HAVE_QUEST); + continue; } + + if (pPlayer->GetQuestStatus(questId) == QUEST_STATUS_COMPLETE) + { + _player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_FINISH_QUEST); + continue; + } + + if (!pPlayer->CanTakeQuest(pQuest, false)) + { + _player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_CANT_TAKE_QUEST); + continue; + } + + if (!pPlayer->SatisfyQuestLog(false)) + { + _player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_LOG_FULL); + continue; + } + + if (pPlayer->GetDivider() != 0) + { + _player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_BUSY); + continue; + } + + pPlayer->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, _player->GetGUID(), true); + pPlayer->SetDivider(_player->GetGUID()); } } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 103f5d605..8b1147a8f 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8086" + #define REVISION_NR "8087" #endif // __REVISION_NR_H__