Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't silently fail when attempting to modify vits (#1476)
For some reason, attempting to modify a vitamin would silently fail when the character's `vitamin_levels` map did not contain that vitamin. However, this map never actually had vitamins added to it... except when the game was loaded, in deserializing the character's vitamin levels. This doesn't appear to be very purposeful, just a side effect of using the ids of the vitamins as keys for the amount of that vitamin, and not bailing out if the key was not found. This meant on the first time a new character was loaded, before you saved and reloaded, any vitamins would not work, particularly the blood vitamins. Stop silently failing when attempting to modify a vitamin that is not already contained, and instead add it to the `vitamin_levels` map, and change the character loading function to avoid the behavior that hid this problem in the past - filling out the vitamin map completely even if there was nothing to load for it. Co-authored-by: anothersimulacrum <42699974+anothersimulacrum@users.noreply.github.com>
- Loading branch information