[8087] Cleanup code. Author: NoFantasy
--HG-- branch : trunk
This commit is contained in:
+18
-22
@@ -439,60 +439,56 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
|
|||||||
{
|
{
|
||||||
CHECK_PACKET_SIZE(recvPacket,4);
|
CHECK_PACKET_SIZE(recvPacket,4);
|
||||||
|
|
||||||
uint32 quest;
|
uint32 questId;
|
||||||
recvPacket >> quest;
|
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 (Quest const *pQuest = objmgr.GetQuestTemplate(questId))
|
||||||
if( pQuest )
|
|
||||||
{
|
{
|
||||||
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();
|
Player *pPlayer = itr->getSource();
|
||||||
|
|
||||||
if (!pPlayer || pPlayer == _player) // skip self
|
if (!pPlayer || pPlayer == _player) // skip self
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_SHARING_QUEST);
|
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_SHARING_QUEST);
|
||||||
|
|
||||||
if( !pPlayer->SatisfyQuestStatus( pQuest, false ) )
|
if (!pPlayer->SatisfyQuestStatus(pQuest, false))
|
||||||
{
|
{
|
||||||
_player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_HAVE_QUEST );
|
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_HAVE_QUEST);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pPlayer->GetQuestStatus( quest ) == QUEST_STATUS_COMPLETE )
|
if (pPlayer->GetQuestStatus(questId) == QUEST_STATUS_COMPLETE)
|
||||||
{
|
{
|
||||||
_player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_FINISH_QUEST );
|
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_FINISH_QUEST);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !pPlayer->CanTakeQuest( pQuest, false ) )
|
if (!pPlayer->CanTakeQuest(pQuest, false))
|
||||||
{
|
{
|
||||||
_player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_CANT_TAKE_QUEST );
|
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_CANT_TAKE_QUEST);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !pPlayer->SatisfyQuestLog( false ) )
|
if (!pPlayer->SatisfyQuestLog(false))
|
||||||
{
|
{
|
||||||
_player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_LOG_FULL );
|
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_LOG_FULL);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pPlayer->GetDivider() != 0 )
|
if (pPlayer->GetDivider() != 0)
|
||||||
{
|
{
|
||||||
_player->SendPushToPartyResponse( pPlayer, QUEST_PARTY_MSG_BUSY );
|
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_BUSY);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPlayer->PlayerTalkClass->SendQuestGiverQuestDetails( pQuest, _player->GetGUID(), true );
|
pPlayer->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, _player->GetGUID(), true);
|
||||||
pPlayer->SetDivider( _player->GetGUID() );
|
pPlayer->SetDivider(_player->GetGUID());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user