diff --git a/src/game/Player.cpp b/src/game/Player.cpp index c34d16eed..2f77eec29 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -13574,8 +13574,6 @@ void Player::CompleteQuest(uint32 quest_id) { if (qInfo->HasFlag(QUEST_FLAGS_AUTO_REWARDED)) RewardQuest(qInfo, 0, this, false); - else - SendQuestComplete(quest_id); } } } @@ -14312,7 +14310,10 @@ void Player::AreaExploredOrEventHappens( uint32 questId ) if(!q_status.m_explored) { + SetQuestSlotState(log_slot, QUEST_STATE_COMPLETE); + SendQuestCompleteEvent(questId); q_status.m_explored = true; + if (q_status.uState != QUEST_NEW) q_status.uState = QUEST_CHANGED; } @@ -14732,14 +14733,15 @@ bool Player::HasQuestForItem( uint32 itemid ) const return false; } -void Player::SendQuestComplete( uint32 quest_id ) +// Used for quests having some event (explore, escort, "external event") as quest objective. +void Player::SendQuestCompleteEvent(uint32 quest_id) { - if( quest_id ) + if (quest_id) { - WorldPacket data( SMSG_QUESTUPDATE_COMPLETE, 4 ); + WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4); data << uint32(quest_id); - GetSession()->SendPacket( &data ); - DEBUG_LOG( "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id ); + GetSession()->SendPacket(&data); + DEBUG_LOG("WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id); } } @@ -16174,6 +16176,9 @@ void Player::_LoadQuestStatus(QueryResult *result) { SetQuestSlot(slot, quest_id, uint32(quest_time)); + if (questStatusData.m_explored) + SetQuestSlotState(slot, QUEST_STATE_COMPLETE); + if (questStatusData.m_status == QUEST_STATUS_COMPLETE) SetQuestSlotState(slot, QUEST_STATE_COMPLETE); diff --git a/src/game/Player.h b/src/game/Player.h index 6159885e1..593886c1e 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1497,7 +1497,7 @@ class MANGOS_DLL_SPEC Player : public Unit void UpdateForQuestWorldObjects(); bool CanShareQuest(uint32 quest_id) const; - void SendQuestComplete( uint32 quest_id ); + void SendQuestCompleteEvent(uint32 quest_id); void SendQuestReward( Quest const *pQuest, uint32 XP, Object* questGiver ); void SendQuestFailed( uint32 quest_id ); void SendQuestTimerFailed( uint32 quest_id ); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 38dda07ad..410358dd7 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 "10632" + #define REVISION_NR "10633" #endif // __REVISION_NR_H__