When you swap out a fish with a manually set preferred location for a gathering item with a preferred location by default, the internal data doesn't update to clear out the manual preferred location.
This results in a cast exception as the logic of the plugin wants to then convert a Gatherable class into a Fish class.
The only way to recover from this crash is to manually edit the PluginConfig alarms.json as the game will lock up upon loading of the GatherBuddy plugin on boot.
Reproduce steps:
Select fish with no preferred location (ex: Miounnefish)
Change the prefered location (ex: Dimwold)
Enable the alarm
Disable the alarm
Change the item to something with a preferred location (ex: Adamantite Ore)
Enable alarm
Stacktrace:
System.InvalidCastException: Unable to cast object of type 'GatherBuddy.Classes.Gatherable' to type 'GatherBuddy.Classes.Fish'.
at GatherBuddy.Alarms.AlarmManager.GetUptime(Alarm alarm) in /work/repo/GatherBuddy/Alarms/AlarmManager.cs:line 181
at GatherBuddy.Gui.Interface.DrawAlarmInfo(Int32& alarmIdx, AlarmGroup group) in /work/repo/GatherBuddy/Gui/Interface.AlarmTab.cs:line 229
at GatherBuddy.Gui.Interface.DrawAlarmTable(AlarmGroup group, Int32 _) in /work/repo/GatherBuddy/Gui/Interface.AlarmTab.cs:line 284
at GatherBuddy.Gui.Interface.DrawAlarmInfo(AlarmGroup group, Int32 idx) in /work/repo/GatherBuddy/Gui/Interface.AlarmTab.cs:line 316
at OtterGui.ItemDetailsWindow.Draw(String label, Action drawHeader, Action drawDetails) in /work/repo/OtterGui/ItemSelector.cs:line 473
at GatherBuddy.Gui.Interface.DrawAlarmTab() in /work/repo/GatherBuddy/Gui/Interface.AlarmTab.cs:line 363
at GatherBuddy.Gui.Interface.Draw() in /work/repo/GatherBuddy/Gui/Interface.cs:line 61
at Dalamud.Interface.Windowing.Window.DrawInternal(DalamudConfiguration configuration) in C:\goatsoft\companysecrets\dalamud\\Interface\Windowing\Window.cs:line 346
When you swap out a fish with a manually set preferred location for a gathering item with a preferred location by default, the internal data doesn't update to clear out the manual preferred location. This results in a cast exception as the logic of the plugin wants to then convert a
Gatherable
class into aFish
class. The only way to recover from this crash is to manually edit the PluginConfigalarms.json
as the game will lock up upon loading of the GatherBuddy plugin on boot.Reproduce steps:
Stacktrace:
Faulty json payload (after reproducing steps):
Expected json payload: