One of the bugs in the game that has bothered me for the longest time is adding multiple items to inventories. When the game wants to add an item to an inventory (be it the player, a chest, or anything) it calls the function "can add to inventory" which gives back some information about how many of the item in question could be added to the inventory, be it none, one, or 10,000. The problem arises when you want to add multiple types of items to an inventory all at once. You can't just call "can add to inventory" for each item as putting the first into the inventory might prevent the second from being added and the add to inventory function only works on the current state of the inventory not potential changes. This week I finally decided to tackle this problem as I was tired of thinking about the lost items and dupe bugs that could arise (yes these are the things that keep me up at night). I went with creating a "test inventory" that is an exact copy of the destination at the time of the move and adding the items that need to be moved into that test inventory. The test inventory gives back a simple yes or no and the items in question can then be added to the destination if they will fit. The most common use case for this is the removal of buildings as now you will not be able to remove a building if all the items in every inventory in the building and the building itself fit in your inventory.
There were a lot of other small fixes this week including a first pass at science diminishing returns as well as an update to player reach distance. Build range up to 5m and mining range down to 2.5m if that mining range feels too short let me know as I am on the fence about it myself.
If there are any other bugs that are bugging you let me know and I will try to fix them.
