Skip to content

Commit 9942ba6

Browse files
committed
[bugfix] Continue game with normal start in prepare* without event
1 parent 3aff9e8 commit 9942ba6

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

internal/app/controller/engine.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ func (e *Engine) SendCommand(command RefCommand, forTeam Team) {
5757
e.State.CommandFor = forTeam
5858
e.LogCommand()
5959

60+
if command == CommandTimeout {
61+
e.State.TeamState[forTeam].TimeoutsLeft--
62+
} else if command == CommandNormalStart {
63+
e.updatePreStages()
64+
}
65+
6066
if command.ContinuesGame() {
6167
if len(e.State.GameEvents) > 0 {
6268
e.State.GameEvents = []*GameEvent{}
@@ -98,6 +104,8 @@ func (e *Engine) Continue() {
98104
e.SendCommand(CommandHalt, "")
99105
} else if e.State.NextCommand != CommandUnknown {
100106
e.SendCommand(e.State.NextCommand, e.State.NextCommandFor)
107+
} else if e.State.Command == CommandPenalty || e.State.Command == CommandKickoff {
108+
e.SendCommand(CommandNormalStart, "")
101109
}
102110
}
103111

@@ -370,12 +378,6 @@ func (e *Engine) processEvent(event Event) error {
370378
}
371379

372380
func (e *Engine) processCommand(c *EventCommand) error {
373-
374-
if c.Type == CommandTimeout {
375-
e.State.TeamState[*c.ForTeam].TimeoutsLeft--
376-
} else if c.Type == CommandNormalStart {
377-
e.updatePreStages()
378-
}
379381
switch c.Type {
380382
case CommandDirect, CommandIndirect, CommandKickoff, CommandPenalty, CommandTimeout, CommandBallPlacement:
381383
if c.ForTeam == nil {

src/components/control/ControlGeneral.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<b-button v-hotkey="keymapContinue"
4242
ref="btnContinue"
4343
v-on:click="triggerContinue"
44-
v-bind:disabled="!gameEventPresent || (!stopped && !ballPlacement)">
44+
v-bind:disabled="!continuePossible">
4545
Continue
4646
</b-button>
4747
</span>
@@ -156,6 +156,9 @@
156156
},
157157
autoContinue() {
158158
return this.state.autoContinue;
159+
},
160+
continuePossible() {
161+
return (this.gameEventPresent && (this.stopped || this.ballPlacement)) || this.prepareSth;
159162
}
160163
}
161164
}

0 commit comments

Comments
 (0)