Core/Quest: Fix SMSG_QUESTGIVER_STATUS_MULTIPLE
By Davide
This commit is contained in:
1 parent
1289e66d44
commit
c5f17620df
2 files changed
+9
-42
No files matched your search
@@ -2914,6 +2914,9 @@ void Player::GiveLevel(uint8 level)
|
||||
if (Pet* pet = GetPet())
|
||||
pet->SynchronizeLevelWithOwner();
|
||||
|
||||
//Update QuestGivers
|
||||
SendQuestGiverStatusMultiple();
|
||||
|
||||
if (MailLevelReward const* mailReward = sObjectMgr->GetMailLevelReward(level, getRaceMask()))
|
||||
{
|
||||
/// @todo Poor design of mail system
|
||||
@@ -15292,6 +15295,9 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
|
||||
|
||||
SendQuestUpdate(quest_id);
|
||||
|
||||
//Update QuestGivers
|
||||
SendQuestGiverStatusMultiple();
|
||||
|
||||
//lets remove flag for delayed teleports
|
||||
SetCanDelayTeleport(false);
|
||||
|
||||
@@ -16899,7 +16905,7 @@ void Player::SendQuestGiverStatusMultiple()
|
||||
questStatus = GetQuestDialogStatus(questgiver);
|
||||
|
||||
data << uint64(questgiver->GetGUID());
|
||||
data << uint8(questStatus);
|
||||
data << int32(questStatus);
|
||||
++count;
|
||||
}
|
||||
else if (itr->IsGameObject())
|
||||
@@ -16911,7 +16917,7 @@ void Player::SendQuestGiverStatusMultiple()
|
||||
questStatus = GetQuestDialogStatus(questgiver);
|
||||
|
||||
data << uint64(questgiver->GetGUID());
|
||||
data << uint8(questStatus);
|
||||
data << int32(questStatus);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,46 +672,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
|
||||
{
|
||||
TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY");
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
WorldPacket data(SMSG_QUESTGIVER_STATUS_MULTIPLE, 4 + 8 + 4);
|
||||
data << uint32(count); // placeholder
|
||||
|
||||
for (auto itr = _player->m_clientGUIDs.begin(); itr != _player->m_clientGUIDs.end(); ++itr)
|
||||
{
|
||||
uint32 questStatus = DIALOG_STATUS_NONE;
|
||||
|
||||
if (itr->IsAnyTypeCreature())
|
||||
{
|
||||
// need also pet quests case support
|
||||
Creature* questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*GetPlayer(), *itr);
|
||||
if (!questgiver || questgiver->IsHostileTo(_player))
|
||||
continue;
|
||||
if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
|
||||
continue;
|
||||
|
||||
questStatus = _player->GetQuestDialogStatus(questgiver);
|
||||
|
||||
data << uint64(questgiver->GetGUID());
|
||||
data << uint32(questStatus);
|
||||
++count;
|
||||
}
|
||||
else if (itr->IsGameObject())
|
||||
{
|
||||
GameObject* questgiver = GetPlayer()->GetMap()->GetGameObject(*itr);
|
||||
if (!questgiver || questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
|
||||
continue;
|
||||
|
||||
questStatus = _player->GetQuestDialogStatus(questgiver);
|
||||
|
||||
data << uint64(questgiver->GetGUID());
|
||||
data << uint32(questStatus);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
data.put<uint32>(0, count); // write real count
|
||||
SendPacket(&data);
|
||||
_player->SendQuestGiverStatusMultiple();
|
||||
}
|
||||
|
||||
void WorldSession::HandleQueryQuestsCompleted(WorldPacket& /*recvData*/)
|
||||
|
||||
Reference in new issue
Block a user