[10633] Correct behavior for completion of quest objectives.

Rename related function to SendQuestCompleteEvent for clarification of when it's expected to be used.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-10-20 12:57:13 +02:00
parent 8886b86a2b
commit bf2b256720
3 changed files with 14 additions and 9 deletions

View file

@ -13574,8 +13574,6 @@ void Player::CompleteQuest(uint32 quest_id)
{ {
if (qInfo->HasFlag(QUEST_FLAGS_AUTO_REWARDED)) if (qInfo->HasFlag(QUEST_FLAGS_AUTO_REWARDED))
RewardQuest(qInfo, 0, this, false); RewardQuest(qInfo, 0, this, false);
else
SendQuestComplete(quest_id);
} }
} }
} }
@ -14312,7 +14310,10 @@ void Player::AreaExploredOrEventHappens( uint32 questId )
if(!q_status.m_explored) if(!q_status.m_explored)
{ {
SetQuestSlotState(log_slot, QUEST_STATE_COMPLETE);
SendQuestCompleteEvent(questId);
q_status.m_explored = true; q_status.m_explored = true;
if (q_status.uState != QUEST_NEW) if (q_status.uState != QUEST_NEW)
q_status.uState = QUEST_CHANGED; q_status.uState = QUEST_CHANGED;
} }
@ -14732,7 +14733,8 @@ bool Player::HasQuestForItem( uint32 itemid ) const
return false; 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)
{ {
@ -16174,6 +16176,9 @@ void Player::_LoadQuestStatus(QueryResult *result)
{ {
SetQuestSlot(slot, quest_id, uint32(quest_time)); SetQuestSlot(slot, quest_id, uint32(quest_time));
if (questStatusData.m_explored)
SetQuestSlotState(slot, QUEST_STATE_COMPLETE);
if (questStatusData.m_status == QUEST_STATUS_COMPLETE) if (questStatusData.m_status == QUEST_STATUS_COMPLETE)
SetQuestSlotState(slot, QUEST_STATE_COMPLETE); SetQuestSlotState(slot, QUEST_STATE_COMPLETE);

View file

@ -1497,7 +1497,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void UpdateForQuestWorldObjects(); void UpdateForQuestWorldObjects();
bool CanShareQuest(uint32 quest_id) const; 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 SendQuestReward( Quest const *pQuest, uint32 XP, Object* questGiver );
void SendQuestFailed( uint32 quest_id ); void SendQuestFailed( uint32 quest_id );
void SendQuestTimerFailed( uint32 quest_id ); void SendQuestTimerFailed( uint32 quest_id );

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10632" #define REVISION_NR "10633"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__