Skip to content

Commit

Permalink
Move default value for GetHitModifier
Browse files Browse the repository at this point in the history
  • Loading branch information
BreakBB committed Jan 8, 2025
1 parent ad9bd9d commit 7f711b8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Modules/Data/Melee.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ function _Melee:GetHitRatingBonus()
if CR_HIT_MELEE then
return GetCombatRatingBonus(CR_HIT_MELEE) + _Melee:GetHitTalentBonus() + _Melee:GetHitFromBuffs()
end
return GetHitModifier() + _Melee.GetHitFromRunes()
-- GetHitModifier returns nil on dungeon entering/teleport
return (GetHitModifier() or 0) + _Melee.GetHitFromRunes()
end

function _Melee:GetHitTalentBonus()
Expand Down Expand Up @@ -151,9 +152,7 @@ function Data:MeleeHitMissChanceSameLevel()
end

local hitValue = _Melee:GetHitRatingBonus()
if hitValue then -- This needs to be checked because on dungeon entering it becomes nil
missChance = missChance - hitValue
end
missChance = missChance - hitValue

if missChance < 0 then
missChance = 0
Expand Down Expand Up @@ -182,9 +181,7 @@ function Data:MeleeHitMissChanceBossLevel()
end

local hitValue = _Melee:GetHitRatingBonus()
if hitValue then -- This needs to be checked because on dungeon entering it becomes nil
missChance = missChance - hitValue
end
missChance = missChance - hitValue

if missChance < 0 then
missChance = 0
Expand Down

0 comments on commit 7f711b8

Please sign in to comment.