mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[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:
parent
8886b86a2b
commit
bf2b256720
3 changed files with 14 additions and 9 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue