Repository navigation
fix(coop): keep a campaign's hotseat armed until DISABLE HOTSEAT - #233
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theDebriefingStateconstructor) clearsconnectionTCP::_isHotseatActiveafter 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):
Fix
DebriefingStatenow tellscoopHotseatOnDebriefing()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.pynow 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.battle_end-armed,geoscape-armed,geoscape-window,second_battle-armed,second_battle-swap,disable-off).test_hotseat_turns(itsbattle_end-disarmcell: a New Battle still disarms),test_hotseat_start,test_hotseat_save,test_hotseat_rules,test_hotseat_react_off,test_solo_pause_save_guard.