ConRO Druid

ConRO Druid

820k Downloads

Bug: `NewMoon_CAST` nil value causing error in druid.lua rotation logic

moderncodes opened this issue ยท 1 comments

commented

A nil comparison error occurs in the New Moon spell rotation logic. The _NewMoon_CAST variable is not being properly initialized or updated before comparison operations.

Error Message

3x ConRO_Druid/druid.lua:414: attempt to compare nil with number
[string "@ConRO_Druid/druid.lua"]:414: in function `NextSpell'
[string "@ConRO/core.lua"]:2427: in function `?'
[string "@APR/APR-Core/libs/AceTimer-3.0-17/AceTimer-3.0.lua"]:55: in function <...dOns/APR/APR-Core/libs/AceTimer-3.0/AceTimer-3.0.lua:50>

The error occurs in

if _NewMoon_RDY and (_NewMoon_CHARGES >= 1) and (_AstralPower <= _AstralPower_Max - _Moon_COST) and ((_NewMoon_CAST < _EclipseLunar_DUR) or (_NewMoon_CAST < _EclipseSolar_DUR)) then

Expected Behavior

  • The addon should properly track and update New Moon cast timing
  • The rotation logic should handle cases where New Moon cast timing is not available

Proposed Fix

_NewMoon_CAST = _NewMoon_CAST or 0  -- Add default value

-- Or update the condition to include nil check:
if _NewMoon_RDY and _NewMoon_CAST and ... then

Environment

  • World of Warcraft Version: 11.0.5.57388
  • ConRO Version: v11.0.03
  • ConRO_Druid Version: v11.0.1
  • Character Spec: Elune's Chosen

PS

I could potentially contribute, but it seems like you are ignoring pull requests, so I won't even bother.
Thank you!

commented

I appreciate the report. The issue is actually an error on my part where I called for the cast time from the Spell charges function and not the ability ready function. It will be fixed in next upload.

Thanks again.