AI: improved stability and bug fixes (related to #13290):

- bug's reason: wrong usage of canTarget, add/addTarget, getOpponents, etc;
- fixed that it can target dead players in some use cases (close #13507);
- fixed that it wrongly choose targets in bad/good effects in some use cases;
- fixed that it can't find valid targets in some use cases;
- fixed game freezes and errors with some cards;
This commit is contained in:
Oleg Agafonov 2025-04-19 07:04:55 +04:00
parent b915c6590b
commit 3dc606501d
10 changed files with 219 additions and 204 deletions

View file

@ -391,7 +391,7 @@ public final class SystemUtil {
// 3. system commands
if (runGroup.isSpecialCommand) {
Player opponent = game.getPlayer(game.getOpponents(feedbackPlayer.getId()).stream().findFirst().orElse(null));
Player opponent = game.getPlayer(game.getOpponents(feedbackPlayer.getId(), true).stream().findFirst().orElse(null));
String info;
switch (runGroup.name) {