1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-07 19:27:45 +00:00

Merge pull request #908 from hkAlice/achievos

[3.x] add achv history support;
This commit is contained in:
Mordred 2023-03-05 21:32:53 +01:00 committed by GitHub
commit 700989c68d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,12 +61,12 @@ void AchievementMgr::unlockAchievement( Entity::Player& player, uint32_t achieve
// handle player achievement history
// todo: verify retail behavior due to client copying the last achievement unlocked
/* auto& achvHistory = player.getAchievementHistory();
std::rotate( achvHistory.rbegin(), achvHistory.rbegin() + 1, achvHistory.rend() );
achvHistory[ 0 ] = achievementId;*/
std::rotate( achvData.history.rbegin(), achvData.history.rbegin() + 1, achvData.history.rend() );
achvData.history[ 0 ] = achievementId;
// fire packets
player.setAchievementData( achvData );
Common::Service< World::Manager::PlayerMgr >::ref().onUnlockAchievement( player, achievementId );
// check and add title to player