fix Request icon stuck for nations (#2234)

## Description:

fixes https://github.com/openfrontio/OpenFrontIO/issues/1955

Describe the PR.

Bots previously created requests directly, skipping timeout cleanup and
causing
a stuck “request sent” icon when unhandled. Using
AllianceRequestExecution makes
bots follow the same lifecycle as humans, so requests expire correctly.
## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] I have added relevant tests to the test directory
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

abodcraft1

---------

Co-authored-by: Evan <evanpelle@gmail.com>
This commit is contained in:
Abdallah Bahrawi
2025-10-21 19:55:54 +03:00
committed by GitHub
parent 06de3f1e8f
commit 373e3ef44a
+4 -1
View File
@@ -17,6 +17,7 @@ import { TileRef, euclDistFN } from "../game/GameMap";
import { PseudoRandom } from "../PseudoRandom";
import { GameID } from "../Schemas";
import { boundingBoxTiles, calculateBoundingBox, simpleHash } from "../Util";
import { AllianceRequestExecution } from "./alliance/AllianceRequestExecution";
import { ConstructionExecution } from "./ConstructionExecution";
import { EmojiExecution } from "./EmojiExecution";
import { structureSpawnTileValue } from "./nation/structureSpawnTileValue";
@@ -221,7 +222,9 @@ export class FakeHumanExecution implements Execution {
if (this.random.chance(20)) {
const toAlly = this.random.randElement(enemies);
if (this.player.canSendAllianceRequest(toAlly)) {
this.player.createAllianceRequest(toAlly);
this.mg.addExecution(
new AllianceRequestExecution(this.player, toAlly.id()),
);
}
}