Repository navigation
Commit feabc70
Prevent AI frozen in place
I received a report of AI freeze, which looks like this:
1. AI runs setupEscape() and decides it should escape to the same tile
as it currently occupies (for whatever reason); _escapeTUs is set to 1
2. AI evaluation sets _AIMode to 3 (=escape)
3. at the end of the think() cycle, _escapeTUs is not reset
(because there is no need to move)
Starting from this point setupEscape() is not executed anymore,
because _escapeTUs != 0. And as long as the enemy sees (or knows about)
xcom, it will not re-evaluate. Thus every turn it will just stay where
it is without doing anything (only thing it can do are reaction shots).
The freeze breaks only after turn 20 (or other forced re-evaluate).
Or after save and reload... because _escapeTUs is not saved
and will get reset back to 0 after reload.1 parent 49eb7d6 commit feabc70
3 files changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
81 | 91 | | |
82 | 92 | | |
83 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
887 | 891 | | |
888 | 892 | | |
889 | 893 | | |
| |||
0 commit comments