Fixed a few issues in VendorComponent.
- Corrected serialization to only happen on construction.
- Added functionality to refresh the vendor based on info from the vendor component table
- some whitespaceing inconsistencies.
- Sorted includes.
Tested the vendor in Nimbus Station and when the player re-enters the world, the vendor inventory refreshes, as opposed to previously where the world would need to reset in order to refresh the inventory.
Added support for Items to have a loot source attached to them when dropped or rolled. This fixes the issue where achievements would give the item before it appeared in the achievement window.
I promise I'm not farming changes. I woke up at like 4AM and realised that I'd screwed up in an obvious way. Note to self: You are ALLOWED to change variables.
Wasn't caught in testing because, well, it turns out it's actually impossible to test the edge case this covers, due to the script for the brick console.
Doubt it would have affected anyone, but technically if you had a mission to collect something interactable, and you deleted the items at the same time as interacting with something, this would have counted incorrectly. I'm being defensive because I was an idiot who couldn't read, but in my defence, it was late when I made the first edit, and I'm also a blundering idiot!
Previously, the only check that the user wasn't trashing more items than they had was clientsided, and this could be bypassed by contacting the server to remove items via a console or the like, and then trashing them before the server could respond, resulting in the count for the items being less than iStackCount. This check prevents that underflow.