Skip to content

Commit

Permalink
* Fix daily reward crash
Browse files Browse the repository at this point in the history
  • Loading branch information
jprzimba committed Jan 4, 2025
1 parent 366bc00 commit 6247b62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/creatures/combat/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,10 @@ bool ConditionRegeneration::executeCondition(const std::shared_ptr<Creature> &cr
const auto &player = creature->getPlayer();
int32_t dailyStreak = 0;
if (player) {
dailyStreak = static_cast<int32_t>(player->kv()->scoped("daily-reward")->get("streak")->getNumber());
auto optStreak = player->kv()->scoped("daily-reward")->get("streak");
if (optStreak) {
dailyStreak = static_cast<int32_t>(optStreak->getNumber());
}
}
if (creature->getZoneType() != ZONE_PROTECTION || dailyStreak >= DAILY_REWARD_HP_REGENERATION) {
if (internalHealthTicks >= getHealthTicks(creature)) {
Expand Down

0 comments on commit 6247b62

Please sign in to comment.