I was programming a delegate function for my inventory component when it suddenly decided to not work anymore. It used to work yesterday, but nothing today.
After exploring, i found out it would crash upon assigning a delegate signature to a public delegate. Something that you do all the time when messing with delegates. Ref: Ben UI Delegate example. After opening up the debugger, i found something EXTREMELY strange. The code that would work would have This, Delegate, and Token be proper values. Delegate and Token are empty, and thats to be expected. But the broken component doesnt have a This. It is null when viewed inside the debugger.
The fixed debugger looks like this. The token is a JSON token for API calls, and the delegate has yet to be bound. This references the component itself. It calls the Vehicle api:
This is the broken debugger. Everything is exactly the same because it calls the Inventory API. I expanded the Delegate called onSuccessFetch because i was convinced it was the problem since it crashes upon being assigned. Upon looking close, This is NULL.
Looking further in the debugger, it shows the Owner not even owning an InventoryComponent. Which is wrong because the function wouldnt be calling if it didnt exist. Its also added to the character within the constructor.
Going inside my HTTP comp, i can find the owner. Its the pawn/player. I can then view all the components the player has, and i see that inventory is null along with PEIC.
How th does a non-existent component exist enough to run a function to crash the engine? Why do I get the luck with Schrodinger’s component?