Core/PhaseMgr: Fixed an updateleak that occured if the rewarded quest hadn't requirements

* Fixed the range for phase ids in the phase_definition table
* solves http://www.trinitycore.org/f/topic/8737-condition-quest-rewarded-dosnt-work-instantly/
This commit is contained in:
Naios
2013-06-29 15:44:32 +02:00
parent 13bd999b7d
commit 642ed8a5d2
2 changed files with 6 additions and 0 deletions
@@ -0,0 +1,2 @@
ALTER TABLE `phase_definitions`
CHANGE COLUMN `phaseId` `phaseId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `phasemask`;
@@ -15396,6 +15396,10 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
m_RewardedQuests.insert(quest_id);
m_RewardedQuestsSave[quest_id] = true;
PhaseUpdateData phaseUdateData;
phaseUdateData.AddQuestUpdate(quest_id);
phaseMgr.NotifyConditionChanged(phaseUdateData);
// StoreNewItem, mail reward, etc. save data directly to the database
// to prevent exploitable data desynchronisation we save the quest status to the database too
// (to prevent rewarding this quest another time while rewards were already given out)