triplea-game / triplea

TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.
https://triplea-game.org/
GNU General Public License v3.0
1.34k stars 393 forks source link

Fix 10k rounds reached combat error. #12564

Closed asvitkine closed 5 months ago

asvitkine commented 5 months ago

This would happen when edit mode was left on when switching to an AI player. This changes makes such transitions turn off edit mode as well as making all battle simulations ignore edit mode.

FIxes: https://github.com/triplea-game/triplea/issues/12488

Notes to Reviewer

DanVanAtta commented 5 months ago

This update is a good step forward. Thank you @asvitkine for tracking it down.

This fix makes me think about the case when someone turns on edit mode during combat with AI. There likely is another fix needed somewhere to resolve that type of issue (though, if that fix would be just too gnarly or not, I do not know)

asvitkine commented 5 months ago

This update is a good step forward. Thank you @asvitkine for tracking it down.

This fix makes me think about the case when someone turns on edit mode during combat with AI. There likely is another fix needed somewhere to resolve that type of issue (though, if that fix would be just too gnarly or not, I do not know)

I did check that and it's currently not possible to turn on edit mode outside of your own turn.

Cernelius commented 5 months ago

Wouldn't it make sense that every AI player automatically turns Edit Mode off if it is on when taking over? Meaning that Edit Mode is set to off whenever the control passes to an AI player?

I actually don't even know what happens when the AI is playing with Edit Mode on, but I assume that the AI does not take advantage of it. I have no idea if there is any user-case for letting Edit Mode on while the AI plays.

asvitkine commented 5 months ago

@Cernelius that's what my change does.

Cernelius commented 5 months ago

Oh ok.

Cernelius commented 5 months ago

Also for Does Nothing AI?