Skip to content

Commit

Permalink
Resolve crashes introduced from 0da6263 . Which resoloves issue #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Codinablack committed Oct 8, 2024
1 parent dd3a5cb commit 7955332
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4363,7 +4363,7 @@ bool Game::combatChangeHealth(Creature* attacker, Creature* target, CombatDamage
rewardBossTracking[monsterId] = RewardBossContributionInfo();
}

if (attacker->getPlayer()) {
if (attacker && attacker->getPlayer()) {
uint32_t playerGuid = attacker->getPlayer()->getGUID();
rewardBossTracking[monsterId].playerScoreTable[playerGuid].damageDone += realDamage * g_config.getFloat(ConfigManager::REWARD_RATE_DAMAGE_DONE);
}
Expand All @@ -4377,7 +4377,7 @@ bool Game::combatChangeHealth(Creature* attacker, Creature* target, CombatDamage
rewardBossTracking[monsterId] = RewardBossContributionInfo();
}

if (target->getPlayer()) {
if (target && target->getPlayer()) {
uint32_t playerGuid = target->getPlayer()->getGUID();
rewardBossTracking[monsterId].playerScoreTable[playerGuid].damageTaken += realDamage * g_config.getFloat(ConfigManager::REWARD_RATE_DAMAGE_TAKEN);
}
Expand Down

0 comments on commit 7955332

Please sign in to comment.