homothetyhk / HollowKnight.ItemChanger

A Hollow Knight mod for editing and adding items
GNU Lesser General Public License v2.1
15 stars 12 forks source link

[ERROR]:[ItemChangerMod] - Error on GiveImmediate for item Geo_Chest-Soul_Master: #23

Closed voidlily closed 1 year ago

voidlily commented 1 year ago

This error showed up in my modlog.txt during an archipelago async, not sure exactly of the cause but reporting what i found

[ERROR]:[ItemChangerMod] - Error on GiveImmediate for item Geo_Chest-Soul_Master:
[ERROR]:[ItemChangerMod] - System.NullReferenceException: Object reference not set to an instance of an object
[ERROR]:[ItemChangerMod] -   at GeoCounter.AddGeo (System.Int32 geo) [0x00000] in <2b54cdaf7a934f0eb297d50c4090ea9f>:0 
[ERROR]:[ItemChangerMod] -   at HeroController.AddGeo (System.Int32 amount) [0x00012] in <2b54cdaf7a934f0eb297d50c4090ea9f>:0 
[ERROR]:[ItemChangerMod] -   at ItemChanger.Items.SpawnGeoItem.GiveImmediate (ItemChanger.GiveInfo info) [0x00036] in C:\dev\ItemChanger\ItemChanger\Items\SpawnGeoItem.cs:45 
[ERROR]:[ItemChangerMod] -   at ItemChanger.AbstractItem.Give (ItemChanger.AbstractPlacement placement, ItemChanger.GiveInfo info) [0x0008b] in C:\dev\ItemChanger\ItemChanger\AbstractItem.cs:131 
BadMagic100 commented 1 year ago

See: https://github.com/ArchipelagoMW-HollowKnight/Archipelago.HollowKnight/issues/65

Probably it's just a case of archipelago giving the items "too early" rather than an IC issue (maybe, technically when you should be able to start giving IC items is not very formally defined rn). In the geo case, the error is purely cosmetic. In the soul case you may not get soul. Either way it's on my radar, will have a fix on the Archipelago side at some point but not a huge priority

homothetyhk commented 1 year ago

Closing this since the corresponding AP issue was resolved. Moving forward, I think it is reasonable to say that giving items before the end of startcall is unsafe.