java.lang.ArithmeticException: Division undefined
Syndaryl opened this issue ยท 2 comments
https://1drv.ms/t/s!AqTWbM9NKFyOqDjQHfFgCPUd9rs3
Crash occurs when interacting with cookie. My food history is, I think, empty due to recent death but I am in the diminishing returns phase.
S:food.modifier.formula=IF(count=0,1,((0.5+((((0.5+MAX(1-(count/cur_history_length),0.1)/2))*(((distinct_food_groups_eaten/(total_food_groups-1))+2)/3))/2))+(food_group_count/(total_food_groups-3)))/2.2)
"An ArithmeticException is only thrown with the message "Division undefined" when you attempt to divide zero by zero."
You have to make sure to protect against things like this is in your formula. Likely due to this part, assuming count
is 0 and cur_history_length
is 0:
count/cur_history_length