From f8156c550b4484e0b4a91ed7fd42cd2ade764b8d Mon Sep 17 00:00:00 2001 From: FloPinguin <25036848+FloPinguin@users.noreply.github.com> Date: Tue, 20 Jan 2026 00:49:10 +0100 Subject: [PATCH] Fix random spawn (#2958) ## Description: "You can pick your spawn in random spawn games in v29. You need to open the menu and click on the attack button. That's it." Thats the fix for this problem. Radial menu no longer allows to attack (pick a spawn) while random spawn is enabled. And SpawnExecution got a check so you cannot send malicious intents. ## 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: FloPinguin --- src/client/graphics/layers/RadialMenuElements.ts | 3 +++ src/core/execution/SpawnExecution.ts | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/client/graphics/layers/RadialMenuElements.ts b/src/client/graphics/layers/RadialMenuElements.ts index 6f72f7149..44d63bb1f 100644 --- a/src/client/graphics/layers/RadialMenuElements.ts +++ b/src/client/graphics/layers/RadialMenuElements.ts @@ -572,6 +572,9 @@ export const centerButtonElement: CenterButtonElement = { return true; } if (params.game.inSpawnPhase()) { + if (params.game.config().isRandomSpawn()) { + return true; + } if (tileOwner.isPlayer()) { return true; } diff --git a/src/core/execution/SpawnExecution.ts b/src/core/execution/SpawnExecution.ts index 5f0694fd8..4162e85fc 100644 --- a/src/core/execution/SpawnExecution.ts +++ b/src/core/execution/SpawnExecution.ts @@ -42,6 +42,11 @@ export class SpawnExecution implements Execution { player = this.mg.addPlayer(this.playerInfo); } + // Security: If random spawn is enabled, prevent players from re-rolling their spawn location + if (this.mg.config().isRandomSpawn() && player.hasSpawned()) { + return; + } + this.tile ??= this.randomSpawnLand(); if (this.tile === undefined) {