Skip to content

fix(coop): keep a campaign's hotseat armed until DISABLE HOTSEAT - #233

Merged
NonPolynomialTim merged 2 commits into
mainfrom
claude/campaign-hotseat-stays-armed
Nov 5, 2026
Merged

NonPolynomialTim merged 2 commits into
mainfrom
claude/campaign-hotseat-stays-armed

Conversation

@NonPolynomialTim

Copy link
Copy Markdown
Collaborator

Follow-up to #229 (#136).

Symptom

After #229 a single-player campaign can arm hotseat from OPTIONS > CO-OP > HOST > HOTSEAT MODE > ENABLE HOTSEAT. But the debriefing disarms it after the first battle, so every later campaign battle runs with the AI on the alien side unless the player re-arms hotseat before each mission. Before #139, campaign hotseat stayed on until DISABLE HOTSEAT. The owner has now ruled that it should again: a campaign's hotseat stays on until it is disabled.

Cause

coopHotseatOnDebriefing() (called from the DebriefingState constructor) clears connectionTCP::_isHotseatActive after every battle. That disarm came in with #139, when hotseat could only be armed from New Battle and the comment scoped it to "a single skirmish". It never checked whether the battle belonged to a campaign.

Evidence, from the extended test on main (3 runs, same lines each time):

FAIL battle_end-armed hotseat False
FAIL geoscape-armed hotseat False
FAIL geoscape-window buttons ['START HOST', 'TURNS: PARALLEL', 'CANCEL']
FAIL second_battle-armed hotseat False turn 1 side 0

Fix

DebriefingState now tells coopHotseatOnDebriefing() whether the battle belongs to a campaign (the save has countries). The battle's hotseat state is cleared either way. The toggle is disarmed only after a New Battle, so a campaign's hotseat stays armed until DISABLE HOTSEAT in the HOST window. Returning to the main menu still disarms it. New Battle behaviour is unchanged.

Tests

  • tools/coop_test/test_hotseat_campaign.py now continues past the first campaign battle. At the debriefing and on the Geoscape, hotseat is still armed and the HOST window shows DISABLE HOTSEAT. A second battle with the same squad starts in hotseat, and X-COM's END TURN hands the aliens to player 2 without re-arming. DISABLE HOTSEAT then turns it off and the button reads ENABLE HOTSEAT again.
    • Red on main: 3/3 FAIL (battle_end-armed, geoscape-armed, geoscape-window, second_battle-armed, second_battle-swap, disable-off).
    • Green: 20/20 PASS (10 per slot, 2 at once, 6.1-6.4 s each).
  • Other files run on the fixed build, all PASS: test_hotseat_turns (its battle_end-disarm cell: a New Battle still disarms), test_hotseat_start, test_hotseat_save, test_hotseat_rules, test_hotseat_react_off, test_solo_pause_save_guard.
  • CI weight for the test raised to 12.6 s (now about 6 s locally).

test_hotseat_campaign.py now follows the first campaign battle with the
debriefing and the geoscape (hotseat still armed, the HOST window showing
DISABLE HOTSEAT), a second battle that hands the aliens to player 2 without
re-arming, and DISABLE HOTSEAT turning it off.

Fails on main: the debriefing disarms hotseat after the first battle, so the
second battle runs with the AI on the alien side.
The debriefing disarmed hotseat after every battle, a rule from #139 written
when hotseat could only be armed for one New Battle. In a single-player
campaign that meant every battle after the first ran with the AI on the alien
side unless the player re-armed hotseat before each mission. Before #139 a
campaign's hotseat stayed on until DISABLE HOTSEAT.

DebriefingState now tells coopHotseatOnDebriefing() whether the battle belongs
to a campaign (the save has countries). The battle's hotseat state is cleared
either way; the toggle is disarmed only after a New Battle. Returning to the
main menu still disarms it.
@NonPolynomialTim
NonPolynomialTim enabled auto-merge (squash) November 5, 2026 21:32
@NonPolynomialTim
NonPolynomialTim merged commit 8ccc045 into main Nov 5, 2026
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant