Skip to content

Commit

Permalink
Fix an issue where entering a new game while pressing on the screen o…
Browse files Browse the repository at this point in the history
…r holding the spacebar would immediately skip dialogue.

GitOrigin-RevId: 9d5769a23b3e8c17d4eda6b9280b1deb24607e85
  • Loading branch information
cpojer committed Nov 21, 2024
1 parent 5d6d879 commit 5c27d38
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions hera/GameMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -575,17 +575,17 @@ export default class GameMap extends Component<Props, State> {
preventRemoteActions,
skipDialogue,
} = this.state;
if (behavior?.type === 'null' && this._skipDialogueTimer == null) {
if (
!skipDialogue &&
((!lastActionResponse && preventRemoteActions) ||
lastActionResponse?.type === 'Start' ||
lastActionResponse?.type === 'CharacterMessage' ||
lastActionResponse?.type === 'SetPlayer' ||
hasCharacterMessage(animations))
) {
this.setState({ showSkipDialogue: true });
}
if (
behavior?.type === 'null' &&
this._skipDialogueTimer == null &&
!skipDialogue &&
((!lastActionResponse && preventRemoteActions) ||
lastActionResponse?.type === 'Start' ||
lastActionResponse?.type === 'CharacterMessage' ||
lastActionResponse?.type === 'SetPlayer' ||
hasCharacterMessage(animations))
) {
this.setState({ showSkipDialogue: true });

this._skipDialogueTimer = setTimeout(() => {
this._skipDialogueTimer = null;
Expand Down

0 comments on commit 5c27d38

Please sign in to comment.