TM prototype 2 fix
I have just pushed an updated prototype 2 build out called tm_proto_2_v2.zip.
There was a major issue found in the previous build with the inventory system that has been fixed with this build.
For my fellow devs / nerds out there I will give a quick breakdown of the issue, which is pretty obvious looking back.
The player inv is in an array with index's of 0-1-2-3-4 etc.. When we do a drop all or transfer all we have to use a remove_index not a remove_item as the player will often have duplicate items in there inventory such as 2 full stacks of wood etc..
So we have to reverse loop and remove index's in the order of 4-3-2-1-0
However, when the player sorts there inventory for weight for example the sorted list could point back to our inventory as 2-1-4-3-0 etc. Which when we reverse loop through to make removes we remove index 0 first causing index 1-2-3-4 to become 0-1-2-3 breaking the array when we try to look for index 4 or pointing to bad data etc.
This was easily fixed by unsorting the inventory on a drop or transfer all and putting them back to there original 0-1-2-3-4 order before we reverse through and remove index's.
Thank you to everyone for the feedback and assistance, please keep it coming.
Get Terra Melior
Terra Melior
Survival / Colony Simulation on an alien planet that you Terra Form to establish a viable human colony.
Status | In development |
Author | Hulgarth |
Genre | Survival |
Tags | City Builder, Crafting, Exploration, First-Person, Indie, Singleplayer, Unreal Engine |
More posts
- First round of terrain / weatherOct 28, 2023
- Phae 6 UpdateOct 01, 2023
- TM Phase 6 is live (Final Prototype Build)Sep 30, 2023
- Phase 5 Is ReadyJul 05, 2023
- Phase 4 update~!Jun 28, 2023
- Phase 4 Ready for TestingJun 24, 2023
- TM Phase 3 BeginsApr 27, 2023
- Terra Melior Phase 2Apr 07, 2023
Leave a comment
Log in with itch.io to leave a comment.