mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/Commands): Fix level up achievements not being granted (#19969)
This commit is contained in:
@@ -987,8 +987,12 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
|||||||
|
|
||||||
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_CHECK_ACHIEVS))
|
if (pCurrChar->HasAtLoginFlag(AT_LOGIN_CHECK_ACHIEVS))
|
||||||
{
|
{
|
||||||
pCurrChar->RemoveAtLoginFlag(AT_LOGIN_CHECK_ACHIEVS, true);
|
// If we process the check while players are loading they won't be notified of the changes.
|
||||||
pCurrChar->CheckAllAchievementCriteria();
|
pCurrChar->m_Events.AddEventAtOffset([pCurrChar]
|
||||||
|
{
|
||||||
|
pCurrChar->RemoveAtLoginFlag(AT_LOGIN_CHECK_ACHIEVS, true);
|
||||||
|
pCurrChar->CheckAllAchievementCriteria();
|
||||||
|
}, 1s);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool firstLogin = pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST);
|
bool firstLogin = pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ Category: commandscripts
|
|||||||
EndScriptData */
|
EndScriptData */
|
||||||
|
|
||||||
#include "AccountMgr.h"
|
#include "AccountMgr.h"
|
||||||
|
#include "AchievementMgr.h"
|
||||||
#include "Chat.h"
|
#include "Chat.h"
|
||||||
#include "CommandScript.h"
|
#include "CommandScript.h"
|
||||||
#include "DBCStores.h"
|
#include "DBCStores.h"
|
||||||
@@ -272,6 +273,8 @@ public:
|
|||||||
stmt->SetData(1, playerGuid.GetCounter());
|
stmt->SetData(1, playerGuid.GetCounter());
|
||||||
CharacterDatabase.Execute(stmt);
|
CharacterDatabase.Execute(stmt);
|
||||||
|
|
||||||
|
sAchievementMgr->UpdateAchievementCriteriaForOfflinePlayer(playerGuid.GetCounter(), ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL);
|
||||||
|
|
||||||
sCharacterCache->UpdateCharacterLevel(playerGuid, newLevel);
|
sCharacterCache->UpdateCharacterLevel(playerGuid, newLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user