Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refresh bosstiary tracker kills on boss death #1605

Merged
merged 3 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading