Vae2009 / ConRO_Druid

1 stars 1 forks source link

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

Closed moderncodes closed 2 weeks ago

moderncodes commented 2 weeks ago

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

https://github.com/Vae2009/ConRO_Druid/blob/2cdf63b1d05be0c2a7a56c24987663e3551725e0/druid.lua#L414

Expected Behavior

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

PS

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

Vae2009 commented 2 weeks ago

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.