Zidras / DBM-Warmane

DBM for Warmane (Icecrown, Lordaeron, Frostmourne, Onyxia)
https://discord.gg/CyVWDWS
147 stars 63 forks source link

Range Check: attempt to fix incorrect previous range after bossMode #152

Closed ForestJ316 closed 2 years ago

ForestJ316 commented 2 years ago

If DBM.Options.DontRestoreRange is true then restoreRange will be nil, since it doesn't get assigned non-nil anywhere else. Otherwise it will be set to the current range passed by SetBossRange(), since it passes forceshow argument as true. https://github.com/Zidras/DBM-Warmane/blob/f989be67418f4053c24b3d9397fe0b9eac4de721/DBM-Core/DBM-RangeCheck.lua#L1249-L1260

Then DisableBossMode() will set current range either to nil (and lua nil error from OnUpdate function) or the one that bossMode was using rather than previous one before it. https://github.com/Zidras/DBM-Warmane/blob/f989be67418f4053c24b3d9397fe0b9eac4de721/DBM-Core/DBM-RangeCheck.lua#L1262-L1271

ForestJ316 commented 2 years ago

Since it seems that restoreRange is meant to return the user set range maybe it's a better approach to just disable SetBossRange() passing the argument as true? In that case my 2nd commit shouldn't be necessary, I made it because otherwise it just sets the range on Hide() to the one that bossMode was using. https://github.com/Zidras/DBM-Warmane/blob/f989be67418f4053c24b3d9397fe0b9eac4de721/DBM-Core/DBM-RangeCheck.lua#L1249

Zidras commented 2 years ago

Hey @ForestJ316, since this is a core module, it takes longer for the review process and validation so I will only have time next week.