You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a Borge comparison if the stuntime on either build is zero (due to not taking any impeccable impacts) the comparison code errors out with ZeroDivisionError.
Normally zeros are caught by the if statements checking for zeros but 'stun_duration_inflicted' is a datetime.timedelta object. These don't compare to integers as expected so datetime.timedelta(0) != 0 returns true causing the code to still run dict2[k][vk] / dict1[k][vk] giving the ZeroDivisionError.
Suggested Fix
I only dug into the code to check this one error so main devs might have better ideas. But my suggestion is to add an additional if statement that catches 'stun_duration_inflicted' and runs it through it's own copy of the same comparison code using dict1[k][vk] != datetime.timedelta(0) & dict2[k][vk] != datetime.timedelta(0) respectively. This should compare as expected.
The text was updated successfully, but these errors were encountered:
Issue
When running a Borge comparison if the stuntime on either build is zero (due to not taking any impeccable impacts) the comparison code errors out with ZeroDivisionError.
This is due to these lines:
https://github.com/bhnn/hunter-sim/blob/main/hunter-sim/sim.py#L206
https://github.com/bhnn/hunter-sim/blob/main/hunter-sim/sim.py#L210
Normally zeros are caught by the if statements checking for zeros but 'stun_duration_inflicted' is a datetime.timedelta object. These don't compare to integers as expected so
datetime.timedelta(0) != 0
returns true causing the code to still rundict2[k][vk] / dict1[k][vk]
giving the ZeroDivisionError.Suggested Fix
I only dug into the code to check this one error so main devs might have better ideas. But my suggestion is to add an additional if statement that catches 'stun_duration_inflicted' and runs it through it's own copy of the same comparison code using
dict1[k][vk] != datetime.timedelta(0)
&dict2[k][vk] != datetime.timedelta(0)
respectively. This should compare as expected.The text was updated successfully, but these errors were encountered: