mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 17:53:29 +00:00
Revert "fix: traitor bug when attacking immediately after initiating an alliance (#2044)"
This reverts commit 6f96788406.
This commit is contained in:
@@ -79,12 +79,6 @@ describe("GameImpl", () => {
|
||||
game.executeNextTick();
|
||||
game.executeNextTick();
|
||||
|
||||
// STEP 1: First betray (manually break alliance)
|
||||
const alliance = attacker.allianceWith(defender);
|
||||
expect(alliance).toBeTruthy();
|
||||
attacker.breakAlliance(alliance!);
|
||||
|
||||
// STEP 2: Then attack after betrayal
|
||||
game.addExecution(new AttackExecution(100, attacker, defender.id()));
|
||||
|
||||
do {
|
||||
@@ -92,7 +86,6 @@ describe("GameImpl", () => {
|
||||
} while (attacker.outgoingAttacks().length > 0);
|
||||
|
||||
expect(attacker.isTraitor()).toBe(false);
|
||||
expect(attacker.allianceWith(defender)).toBeFalsy();
|
||||
});
|
||||
|
||||
test("Do become traitor when betraying active player", async () => {
|
||||
@@ -117,13 +110,6 @@ describe("GameImpl", () => {
|
||||
game.executeNextTick();
|
||||
game.executeNextTick();
|
||||
|
||||
// First betray (manually break alliance)
|
||||
const alliance = attacker.allianceWith(defender);
|
||||
expect(alliance).toBeTruthy();
|
||||
attacker.breakAlliance(alliance!);
|
||||
|
||||
game.executeNextTick();
|
||||
|
||||
game.addExecution(new AttackExecution(100, attacker, defender.id()));
|
||||
|
||||
do {
|
||||
@@ -131,6 +117,5 @@ describe("GameImpl", () => {
|
||||
} while (attacker.outgoingAttacks().length > 0);
|
||||
|
||||
expect(attacker.isTraitor()).toBe(true);
|
||||
expect(attacker.allianceWith(defender)).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user