mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[8533] Not remove timed quest and correctly fail when time runs out.
Add function to remove timed quest instead of direct access to set. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
1bf0678ebd
commit
38aac1a77a
4 changed files with 16 additions and 14 deletions
|
|
@ -12602,9 +12602,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
|
|||
DestroyItemCount( pQuest->ReqItemId[i], pQuest->ReqItemCount[i], true);
|
||||
}
|
||||
|
||||
//if( qInfo->HasSpecialFlag( QUEST_FLAGS_TIMED ) )
|
||||
// SetTimedQuest( 0 );
|
||||
m_timedquests.erase(pQuest->GetQuestId());
|
||||
RemoveTimedQuest(quest_id);
|
||||
|
||||
if (pQuest->GetRewChoiceItemsCount() > 0)
|
||||
{
|
||||
|
|
@ -12811,6 +12809,7 @@ void Player::FailQuest(uint32 questId)
|
|||
{
|
||||
QuestStatusData& q_status = mQuestStatus[questId];
|
||||
|
||||
RemoveTimedQuest(questId);
|
||||
q_status.m_timer = 0;
|
||||
|
||||
SendQuestTimerFailed(questId);
|
||||
|
|
@ -13036,12 +13035,13 @@ bool Player::SatisfyQuestStatus( Quest const* qInfo, bool msg )
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Player::SatisfyQuestTimed( Quest const* qInfo, bool msg )
|
||||
bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg)
|
||||
{
|
||||
if ( (find(m_timedquests.begin(), m_timedquests.end(), qInfo->GetQuestId()) != m_timedquests.end()) && qInfo->HasFlag(QUEST_MANGOS_FLAGS_TIMED) )
|
||||
if (!m_timedquests.empty() && qInfo->HasFlag(QUEST_MANGOS_FLAGS_TIMED))
|
||||
{
|
||||
if( msg )
|
||||
SendCanTakeQuestResponse( INVALIDREASON_QUEST_ONLY_ONE_TIMED );
|
||||
if (msg)
|
||||
SendCanTakeQuestResponse(INVALIDREASON_QUEST_ONLY_ONE_TIMED);
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -13269,12 +13269,6 @@ void Player::SetQuestStatus(uint32 quest_id, QuestStatus status)
|
|||
{
|
||||
if (Quest const* qInfo = objmgr.GetQuestTemplate(quest_id))
|
||||
{
|
||||
if (status == QUEST_STATUS_NONE || status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE || status == QUEST_STATUS_FAILED)
|
||||
{
|
||||
if (qInfo->HasFlag(QUEST_MANGOS_FLAGS_TIMED))
|
||||
m_timedquests.erase(qInfo->GetQuestId());
|
||||
}
|
||||
|
||||
QuestStatusData& q_status = mQuestStatus[quest_id];
|
||||
|
||||
q_status.m_status = status;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue