Keroro1454 / Supply-Drop

Incoming Supply Drop! Adds new items to enhance your Risk of Rain 2 experience.
GNU General Public License v3.0
1 stars 4 forks source link

Shell Plating code references the body's ShellStackTracker, even when the tracker doesn't exist, causing an error #23

Closed TheMysticSword closed 1 year ago

TheMysticSword commented 3 years ago

https://github.com/Keroro1454/Supply-Drop/blob/dd65c0601b094928f7db0bc76abf3531f3c4da2f/Items/ShellPlating.cs#L260-L267

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
SupplyDrop.Items.ShellPlating.AddShellPlateStats (RoR2.CharacterBody sender, R2API.RecalculateStatsAPI+StatHookEventArgs args) (at <ea26628d56e84b3eb1a0138c4199e432>:IL_005F)
R2API.RecalculateStatsAPI+<>c.<HookRecalculateStats>b__12_0 (RoR2.CharacterBody cb) (at <cbf459747fb84d7a8f33410cd1e6e58e>:IL_0014)
MonoMod.Cil.RuntimeILReferenceBag+FastDelegateInvokers.Invoke[T1] (T1 arg1, MonoMod.Cil.RuntimeILReferenceBag+FastDelegateInvokers+Action`1[T1] del) (at <9218caa36358471fb3c33e4432ee554c>:IL_0000)
RoR2.CharacterBody.RecalculateStats () (at <da7c19fa62814b28bdb8f3a9223868e1>:IL_006B)

The shellStackTrackerComponent local variable should be assigned to when the tracker is created for the first time

Keroro1454 commented 1 year ago

Fixed!