Closed wschella closed 6 years ago
I tried my best reproducing this on 32086cf by playing the initial moves as described, but the expeditions get dispatched as expected. Are you certain the information you provided is correct?
It's not wrong, but maybe incomplete. Just realized the moves that effectively crashed the gamerules might not have been logged in the bot nor in the gamerules
Yes, that will probably be the case. I am quite puzzled by how this issue can happen though, since according to that if statement, which is called on every element as far as I can see, should make sure that turns_remaining > 1.
Unrelated to the bug, but don't we want to preserve the order of the expeditions as commanded by the players? People might expect us to do that so that they don't have to filter their own expeditions when they send too much troops, but their priorities are correct.
The .swap_remove kinda removes this ordering.
@wschella We do keep the order of expeditions as commanded by the player in dispatching, which is unrelated to this code. The only way the ordering you refer to here gets to the players is through the list of expeditions we provide to them, but that shouldn't matter since the expeditions all have an id.
Right!
Since many games have been played since, and this was never observed again, I'd suggest this was due to a glitch in the matrix.
I couldn't immediately find the problem, so i'm pasting relevant details here so I can go on with my work. The only thing that makes sense is us not cleaning up old expeditions or something (it's the only subtraction going on) This happens after the bots made their first move, map is standard hex:
Player 1:
Player 2:
Stacktrace:
Relevant code: