I have another problem that's sorta unrelated to the topic but I'm going to just stick it in here.
if (total_exp >= exp_to_next_lvl)
if (lvl != max_lvl)
This function is being put into my game loop somewhere, and somewhere else I'm increasing total_exp using a different function. The problem is that once I reach the first exp_to_next_lvl (which happens to be 100) it won't stop incrementing until it reaches max_lvl, which is 20. It's suppose to increment lvl once after total_exp matches exp_to_next_lvl, obviously, but it's just not doing that.