90
Thanks, that was pretty fast and the problems seem fixed. Yeah, that last point about software development is definitely true a lot, lol. Speaking of reworking items, I just figured I'd let you know that misc. items haven't been properly applying their Skill, Stat, or Trait effects for a while now, so that may be something worth investigating when you do get around to items if you weren't aware already. They do still correctly apply any effects that specifically check for the item, such as the end of week events for the nightmare orb or the chrono bed.
Edit: Nevermind, I don't believe the first issue is completely fixed with how you modified the LevelUp function. While the original bug message does seem to be gone, I am instead getting variations similar to this new error message under the same conditions:
"Error when processing building Farm: basic_string::_M_construct null not valid"
I believe that it is likely that some of the functions that the gain_trait functions relies upon aren't able to handle the nullptr that your fix introduces, instead producing the new message because I can no longer reproduce the error if I once again adjust the random index range to not include the nullptr.