Junie-774 / CraftingList

8 stars 4 forks source link

API9 fixes #25

Closed drejjmit closed 1 year ago

drejjmit commented 1 year ago

Fixes

Chat commands https://github.com/drejjmit/CraftingList/commit/942cfc09219b7b74b9d1e9ea847b41fc4382f4b3

15:06:35.408 | DBG [CraftingList] [CraftHelper.ChangeJobs()] Changing jobs to Alchemist
15:06:35.417 | ERR Exception during raise of "Void b__0()"
System.NullReferenceException: Object reference not set to an instance of an object.
at CraftingList.Utility.ChatManager.SendMessageInternal(String message)
at CraftingList.Utility.ChatManager.FrameworkUpdate(IFramework framework)
at Dalamud.Utility.EventHandlerExtensions.HandleInvoke(Action act) in C:\goatsoft\companysecrets\dalamud\Utility\EventHandlerExtensions.cs:line 112

If a list has 10 entries, you can't call RemoveAt(10) because lists start at 0 https://github.com/drejjmit/CraftingList/commit/13d15dbc545651e3847d4f27f853eb38806a1407

11:32:01.495 ERR | Exception during raise of "Void DrawUI()"
11:32:01.495 ERR | System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
11:32:01.495 ERR |    at System.Collections.Generic.List`1.RemoveAt(Int32 index)
11:32:01.495 ERR |    at CraftingList.UI.CraftingListTab.EntryListTable.DrawNewEntry() in C:\Users\x\Source\Repos\CraftingList\CraftingList\UI\CraftingListTab\EntryListTable.cs:line 236
11:32:01.495 ERR |    at CraftingList.UI.CraftingListTab.CraftingListTab.Draw() in C:\Users\x\Source\Repos\CraftingList\CraftingList\UI\CraftingListTab\CraftingListTab.cs:line 36
11:32:01.495 ERR |    at CraftingList.PluginUI.DrawSettingsWindow() in C:\Users\x\Source\Repos\CraftingList\CraftingList\UI\PluginUI.cs:line 114
11:32:01.495 ERR |    at CraftingList.PluginUI.Draw() in C:\Users\x\Source\Repos\CraftingList\CraftingList\UI\PluginUI.cs:line 75
11:32:01.495 ERR |    at CraftingList.CraftingList.DrawUI() in C:\Users\x\Source\Repos\CraftingList\CraftingList\CraftingList.cs:line 147
11:32:01.495 ERR |    at Dalamud.Utility.EventHandlerExtensions.HandleInvoke(Action act) in C:\goatsoft\companysecrets\dalamud\Utility\EventHandlerExtensions.cs:line 112

Repair https://github.com/drejjmit/CraftingList/commit/1284eb842109ade823b5673d6552db760f39bebf

11:33:35.990 ERR | Unobserved exception in Task.
11:33:35.990 ERR | System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Object reference not set to an instance of an object.)
11:33:35.990 ERR |  ---> System.NullReferenceException: Object reference not set to an instance of an object.
11:33:35.990 ERR |    at CraftingList.SeFunctions.PtrRepair.ClickRepairAll() in C:\Users\x\Source\Repos\CraftingList\CraftingList\SeFunctions\PtrRepair.cs:line 24
11:33:35.990 ERR |    at CraftingList.Crafting.CraftHelper.Repair() in C:\Users\x\Source\Repos\CraftingList\CraftingList\Crafting\CraftHelper.cs:line 275
11:33:35.990 ERR |    at CraftingList.Crafting.Crafter.QuickSynthesizeEntry(CListEntry entry) in C:\Users\x\Source\Repos\CraftingList\CraftingList\Crafting\Crafter.cs:line 276
11:33:35.990 ERR |    at CraftingList.Crafting.Crafter.<CraftAllItems>b__5_0() in C:\Users\x\Source\Repos\CraftingList\CraftingList\Crafting\Crafter.cs:line 79
drejjmit commented 1 year ago

Fixes #23, #24

Junie-774 commented 1 year ago

oop i just came back to working on the plugin and fixed it before looking at this. I really appreciate the effort, though! ^^.

So they moved the repairall button to a different offset... hmm, i thought they just decided to stop using that field. That's a good catch, how'd you figure that out? I found it again just by calling AddonRepair's GetButtonNodeById(16), finding the button's id through the dalamud data explorer. I'm going to keep mine just cause it was already changed, but i might end up swapping to your method in the future, i'm not sure how volatile component IDs are.

Thank you so much for the changes though! ^^. I was so confused on why sending chats was broken