Fix co-op off-turn cursor being incorrectly set/persisted to aim cursor#9
Open
NonPolynomialTim wants to merge 1 commit into
Open
Fix co-op off-turn cursor being incorrectly set/persisted to aim cursor#9NonPolynomialTim wants to merge 1 commit into
NonPolynomialTim wants to merge 1 commit into
Conversation
Two pre-existing co-op bugs where the off-turn player's cursor was wrongly driven into the aiming (CT_AIM) state instead of the standard box cursor. 1. Ending a turn with the aiming cursor out: the co-op end-turn handoff in BattlescapeState::btnEndTurnClick sets is_return=true and skips requestEndTurn(), so BattlescapeGame::endTurn() (which normally clears targeting and resets the cursor) never runs for the ending player. Reset it explicitly via cancelCurrentActionCoop(true) after the handoff. 2. A teammate firing: at the end of a synced shot ProjectileFlyBState calls setupCursor() when getSide()==FACTION_PLAYER, which is still true for the off-turn co-op client, flipping its cursor to CT_AIM. Guard setupCursor() so that while it is not our turn (coop && isYourTurn != 2) it keeps the normal box cursor and ignores the active player's action. This also covers throw/psi/launch actions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Two co-op bugs where the off-turn player's cursor was wrongly driven into the aiming (CT_AIM) state instead of the standard box cursor.
Ending a turn with the aiming cursor out: the co-op end-turn handoff in BattlescapeState::btnEndTurnClick sets is_return=true and skips requestEndTurn(), so BattlescapeGame::endTurn() (which normally clears targeting and resets the cursor) never runs for the ending player. Reset it explicitly via cancelCurrentActionCoop(true) after the handoff.
A teammate firing: at the end of a synced shot ProjectileFlyBState calls setupCursor() when getSide()==FACTION_PLAYER, which is still true for the off-turn co-op client, flipping its cursor to CT_AIM. Guard setupCursor() so that while it is not our turn (coop && isYourTurn != 2) it keeps the normal box cursor and ignores the active player's action. This also covers throw/psi/launch actions.