mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 07:50:45 +00:00
[FIX] Filters actionable events to remove dead requestors (#4238)
Resolves #4220 ## Description: Filters `ActionableEvents` to remove dead requestors. ## 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 - [ ] I have added relevant tests to the test directory **I do not know how** to create and then kill a player in `tests/client/graphics/layers/ActionableEventsAlliance.test.ts`. ## Please put your Discord username so you can be contacted if a bug or regression is found: Katokoda
This commit is contained in:
@@ -120,10 +120,14 @@ export class ActionableEvents extends LitElement implements Controller {
|
||||
(event.duration === undefined ||
|
||||
this.game.ticks() - event.createdAt < event.duration) &&
|
||||
(event.type !== MessageType.ALLIANCE_REQUEST ||
|
||||
// We remove Alliance Requests if the requestor is no longer requesting an alliance with us.
|
||||
(
|
||||
// We remove Alliance Requests if the requestor is dead.
|
||||
((
|
||||
this.game.playerBySmallID(event.requestorID) as PlayerView
|
||||
).isRequestingAllianceWith(this.game.myPlayer() as PlayerView)),
|
||||
).isAlive() &&
|
||||
// We remove Alliance Requests if the requestor is no longer requesting an alliance with us.
|
||||
(
|
||||
this.game.playerBySmallID(event.requestorID) as PlayerView
|
||||
).isRequestingAllianceWith(this.game.myPlayer() as PlayerView))),
|
||||
);
|
||||
|
||||
if (this.events.length !== remainingEvents.length) {
|
||||
|
||||
Reference in New Issue
Block a user