mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 09:10:42 +00:00
Revert "Fix: Nations reject alliance requests during spawn phase" (#3313)
## Description: Reverts openfrontio/OpenFrontIO#3312 ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] 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: w.o.n
This commit is contained in:
@@ -76,11 +76,6 @@ export class NationAllianceBehavior {
|
||||
otherPlayer: Player,
|
||||
isResponse: boolean,
|
||||
): boolean {
|
||||
// Reject alliance requests during the spawn phase
|
||||
if (this.game.inSpawnPhase()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Easy (dumb) nations sometimes get confused and accept/reject randomly (Just like dumb humans do)
|
||||
if (this.isConfused()) {
|
||||
return this.random.chance(2);
|
||||
|
||||
@@ -51,10 +51,6 @@ describe("AllianceBehavior.handleAllianceRequests", () => {
|
||||
player,
|
||||
new NationEmojiBehavior(random, game, player),
|
||||
);
|
||||
|
||||
while (game.inSpawnPhase()) {
|
||||
game.executeNextTick();
|
||||
}
|
||||
});
|
||||
|
||||
function setupAllianceRequest({
|
||||
@@ -96,16 +92,6 @@ describe("AllianceBehavior.handleAllianceRequests", () => {
|
||||
return mockRequest;
|
||||
}
|
||||
|
||||
test("should reject alliance during spawn phase", () => {
|
||||
vi.spyOn(game, "inSpawnPhase").mockReturnValue(true);
|
||||
const request = setupAllianceRequest({});
|
||||
|
||||
allianceBehavior.handleAllianceRequests();
|
||||
|
||||
expect(request.accept).not.toHaveBeenCalled();
|
||||
expect(request.reject).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test("should accept alliance when all conditions are met", () => {
|
||||
const request = setupAllianceRequest({});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user