Hey to all.
I had asked about this in a previous thread but it has been a while so I wanted to make a new thread.
Making an Inventory system for a RPG game. Want to remove items from player’s inventory (when used or dropped) But I want to keep the indieces of course so in the UI things don’t shift when items are removed.
Someone suggested making a default nullptr value and replacing the removed item with that one so the order of array is preserved. I tried but I am getting crashes: Access violation - code c0000005 (first/second chance not available) a common nllptr crash). I get this with usually pointer errors.
Here is what I do :
FInventoryItem* EmptyInventorySlot = nullptr; Inventory = *EmptyInventorySlot; UpdateInventory();
This is the question and before I mentioned
I use 4.18 and VS 2017.
I can give more details if it is required.
Thank you very much.