From 839f5b95d228fda05f31649d83062a3029e3e2dd Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 15 Sep 2023 15:39:06 -0300 Subject: [PATCH] fix: refresh bosstiary tracker kills on boss death --- src/creatures/players/player.cpp | 2 +- src/creatures/players/player.hpp | 4 ++-- src/io/io_bosstiary.cpp | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index b018a9d5e25..c99d06f7bdf 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -1655,7 +1655,7 @@ void Player::onCreatureAppear(Creature* creature, bool isLogin) { } // Reload bestiary tracker - refreshBestiaryMonsterTracker(); + refreshCyclopediaMonsterTracker(); g_game().checkPlayersRecord(); IOLoginData::updateOnlineStatus(guid, true); diff --git a/src/creatures/players/player.hpp b/src/creatures/players/player.hpp index 34bda548582..5f159f0ec37 100644 --- a/src/creatures/players/player.hpp +++ b/src/creatures/players/player.hpp @@ -303,8 +303,8 @@ class Player final : public Creature, public Cylinder, public Bankable { } } - void refreshBestiaryMonsterTracker() const { - refreshCyclopediaMonsterTracker(getCyclopediaMonsterTrackerSet(false), false); + void refreshCyclopediaMonsterTracker(bool isBoss = false) const { + refreshCyclopediaMonsterTracker(getCyclopediaMonsterTrackerSet(isBoss), isBoss); } void refreshCyclopediaMonsterTracker(const phmap::parallel_flat_hash_set> &trackerList, bool isBoss) const { diff --git a/src/io/io_bosstiary.cpp b/src/io/io_bosstiary.cpp index 45a650765c1..afe6c647245 100644 --- a/src/io/io_bosstiary.cpp +++ b/src/io/io_bosstiary.cpp @@ -176,6 +176,7 @@ void IOBosstiary::addBosstiaryKill(Player* player, const std::shared_ptraddBestiaryKillCount(bossId, amount); + player->refreshCyclopediaMonsterTracker(true); auto newBossLevel = getBossCurrentLevel(player, bossId); if (oldBossLevel == newBossLevel) { return;