@@ -288,12 +288,28 @@ func (e *Engine) Continue() {
288288 log .Println ("Continue" )
289289 substitutionIntend := e .State .BotSubstitutionIntend ()
290290 if substitutionIntend != TeamUnknown {
291- teamProto := substitutionIntend .toProto ()
292- event := GameEvent {
293- Type : GameEventBotSubstitution ,
294- Details : GameEventDetails {
295- BotSubstitution : & refproto.GameEvent_BotSubstitution {ByTeam : & teamProto }}}
296- e .AddGameEvent (& event )
291+ if substitutionIntend == TeamBoth {
292+ teamProto := TeamYellow .toProto ()
293+ event := GameEvent {
294+ Type : GameEventBotSubstitution ,
295+ Details : GameEventDetails {
296+ BotSubstitution : & refproto.GameEvent_BotSubstitution {ByTeam : & teamProto }}}
297+ e .AddGameEvent (& event )
298+
299+ teamProto = TeamBlue .toProto ()
300+ event = GameEvent {
301+ Type : GameEventBotSubstitution ,
302+ Details : GameEventDetails {
303+ BotSubstitution : & refproto.GameEvent_BotSubstitution {ByTeam : & teamProto }}}
304+ e .AddGameEvent (& event )
305+ } else {
306+ teamProto := substitutionIntend .toProto ()
307+ event := GameEvent {
308+ Type : GameEventBotSubstitution ,
309+ Details : GameEventDetails {
310+ BotSubstitution : & refproto.GameEvent_BotSubstitution {ByTeam : & teamProto }}}
311+ e .AddGameEvent (& event )
312+ }
297313 e .LogHint ("botSubstitution" , "game halted for bot substitution" , substitutionIntend )
298314 e .State .TeamState [TeamBlue ].BotSubstitutionIntend = false
299315 e .State .TeamState [TeamYellow ].BotSubstitutionIntend = false
0 commit comments