beyond-all-reason / beyond-all-reason/RecoilEngine

## Bug: `luarules playertoteam` leaves moved player unable to resign or be moved to spectator

Open
#3,062 7 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

### Description

When using `/luarules playertoteam` to move a player to an existing team, the moved player shares a teamID with the existing player. This creates a situation where the moved player is effectively stuck for the remainder of the game.

### Expected Behaviour

**Expected behaviour:**
A player moved via `playertoteam` should retain the ability to resign or be moved to spectator independently of the team they were merged into.

### Actual Behaviour

**Observed behaviour:**
- The moved player cannot `!resign` as they share a teamID and have no independent team to resign
- The moved player cannot move themselves to spectator
- Moderators cannot force the moved player to spectator without affecting the entire team they were merged into

### Reproduction steps

**Steps to reproduce:**
1. In a multiplayer game, run `/luarules playertoteam ` to move a player onto an existing team
2. Attempt to have the moved player `!resign`
3. Attempt to move the player to spectator via moderator commands
4. Attempt to have the player move themselves to spectator

### Other

**Impact:**
This is a significant moderation concern. In grief or dispute scenarios where `playertoteam` is used as an intervention tool, the moved player can become permanently stuck with no clean resolution available to moderators.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the /luarules playertoteam command and how it assigns teamID, then follow the existing !resign and spectator-move paths for merged players. Reproduce the listed multiplayer scenario and verify that the moved player can resign or enter spectator mode without changing the existing team's state.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, lua
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.