Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Assert in attack_prediction.cpp / calculate_probability_of_debuff #2608
Reproducible in 16f86dd432539f8bb135e9fe388914c835ec1045 (the current trunk). Load the not-attached* save game, end turn, and there's a roughly 50% chance that the assert will be hit during the AI turn. * not attached because GitHub is refusing it, I'll upload to the forums and add a link.
If I guess correctly, the bug requires three attacks in the AI turn, all attacking the same defender:
The assert happens after the GUI has shown the first attack, when it's analysing further attacks.
It's useful for debugging to add an assert after attack_prediction.cpp:2431 that triggers when the Monte Carlo simulation calculates a greater-than-1 probability of being slowed. Without it, the other assert happens when a later call reaches attack_prediction.cpp:2423 and passes this greater-than-1 probability to calculate_probability_of_debuff().