Skip to content

Commit

Permalink
fix: refresh bosstiary tracker kills on boss death
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Sep 15, 2023
1 parent 2d1aa9e commit 839f5b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ void Player::onCreatureAppear(Creature* creature, bool isLogin) {
}

// Reload bestiary tracker
refreshBestiaryMonsterTracker();
refreshCyclopediaMonsterTracker();

g_game().checkPlayersRecord();
IOLoginData::updateOnlineStatus(guid, true);
Expand Down
4 changes: 2 additions & 2 deletions src/creatures/players/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::shared_ptr<MonsterType>> &trackerList, bool isBoss) const {
Expand Down
1 change: 1 addition & 0 deletions src/io/io_bosstiary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ void IOBosstiary::addBosstiaryKill(Player* player, const std::shared_ptr<Monster

auto oldBossLevel = getBossCurrentLevel(player, bossId);
player->addBestiaryKillCount(bossId, amount);
player->refreshCyclopediaMonsterTracker(true);
auto newBossLevel = getBossCurrentLevel(player, bossId);
if (oldBossLevel == newBossLevel) {
return;
Expand Down

0 comments on commit 839f5b9

Please sign in to comment.