@@ -93,19 +93,23 @@ func (c *GameController) askForTeamDecisionIfRequired(event Event) (handled bool
9393 handled = false
9494 if c .outstandingTeamChoice == nil && c .Engine .State .GameState () == GameStateRunning {
9595 var byTeamProto refproto.Team
96- var choiceType refproto.AdvantageChoice_Foul
96+ var choice refproto.AdvantageChoice
97+ choice .Foul = new (refproto.AdvantageChoice_Foul )
9798 if event .GameEvent .Details .BotCrashUnique != nil {
9899 byTeamProto = * event .GameEvent .Details .BotCrashUnique .ByTeam
99- choiceType = refproto .AdvantageChoice_COLLISION
100+ * choice .Foul = refproto .AdvantageChoice_COLLISION
101+ choice .BotCrashUnique = new (refproto.GameEvent_BotCrashUnique )
102+ * choice .BotCrashUnique = * event .GameEvent .Details .BotCrashUnique
100103 } else if event .GameEvent .Details .BotPushedBot != nil {
101104 byTeamProto = * event .GameEvent .Details .BotPushedBot .ByTeam
102- choiceType = refproto .AdvantageChoice_PUSHING
105+ * choice .Foul = refproto .AdvantageChoice_PUSHING
106+ choice .BotPushedBot = new (refproto.GameEvent_BotPushedBot )
107+ * choice .BotPushedBot = * event .GameEvent .Details .BotPushedBot
103108 }
104109
105110 forTeam := NewTeam (byTeamProto ).Opposite ()
106111 if forTeam != "" {
107112 teamName := c .Engine .State .TeamState [forTeam ].Name
108- choice := refproto.AdvantageChoice {Foul : & choiceType }
109113 requestPayload := refproto.ControllerToTeam_AdvantageChoice {AdvantageChoice : & choice }
110114 request := refproto.ControllerToTeam {Msg : & requestPayload }
111115 err := c .TeamServer .SendRequest (teamName , request )
0 commit comments