mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 09:14:09 +00:00
bugfix: don't show yellow alert frame when a bot is attacking
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators.js";
|
import { customElement, state } from "lit/decorators.js";
|
||||||
|
import { PlayerType } from "../../../core/game/Game";
|
||||||
import {
|
import {
|
||||||
BrokeAllianceUpdate,
|
BrokeAllianceUpdate,
|
||||||
GameUpdateType,
|
GameUpdateType,
|
||||||
} from "../../../core/game/GameUpdates";
|
} from "../../../core/game/GameUpdates";
|
||||||
import { GameView } from "../../../core/game/GameView";
|
import { GameView, PlayerView } from "../../../core/game/GameView";
|
||||||
import { UserSettings } from "../../../core/game/UserSettings";
|
import { UserSettings } from "../../../core/game/UserSettings";
|
||||||
import { Layer } from "./Layer";
|
import { Layer } from "./Layer";
|
||||||
|
|
||||||
@@ -198,6 +199,12 @@ export class AlertFrame extends LitElement implements Layer {
|
|||||||
for (const attack of incomingAttacks) {
|
for (const attack of incomingAttacks) {
|
||||||
// Only alert for non-retreating attacks
|
// Only alert for non-retreating attacks
|
||||||
if (!attack.retreating && !this.seenAttackIds.has(attack.id)) {
|
if (!attack.retreating && !this.seenAttackIds.has(attack.id)) {
|
||||||
|
const attacker = this.game.playerBySmallID(attack.attackerID);
|
||||||
|
if ((attacker as PlayerView).type() === PlayerType.Bot) {
|
||||||
|
this.seenAttackIds.add(attack.id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this is a retaliation (we attacked them recently)
|
// Check if this is a retaliation (we attacked them recently)
|
||||||
const ourAttackTick = this.outgoingAttackTicks.get(attack.attackerID);
|
const ourAttackTick = this.outgoingAttackTicks.get(attack.attackerID);
|
||||||
const isRetaliation =
|
const isRetaliation =
|
||||||
|
|||||||
Reference in New Issue
Block a user