Skip to content

Commit

Permalink
fix: crash on daily reward (opentibiabr#3215)
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored and vllworldbuilding committed Jan 10, 2025
1 parent 7cf31d1 commit 939ad62
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 @@ -1413,7 +1413,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 939ad62

Please sign in to comment.