Skip to content

Commit f30c89f

Browse files
committed
fix bug
1 parent 0bda347 commit f30c89f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/grpc-client/grpc_client_player.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -899,9 +899,16 @@ void GrpcClientPlayer::getActions()
899899
rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_ScanPlayers failed" );
900900
}
901901
}
902-
else if (action.action_case() == PlayerAction::kBhvGoalieFreeKick) {
903-
Bhv_GoalieFreeKick().execute(agent);
904-
agent->debugClient().addMessage("Bhv_GoalieFreeKick");
902+
else if (action.action_case() == PlayerAction::kBhvGoalieFreeKick && !action_performed) {
903+
if (Bhv_GoalieFreeKick().execute(agent))
904+
{
905+
action_performed = true;
906+
rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Bhv_GoalieFreeKick performed" );
907+
}
908+
else
909+
{
910+
rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Bhv_GoalieFreeKick failed" );
911+
}
905912
}
906913
else if (action.action_case() == PlayerAction::kNeckTurnToBallAndPlayer) {
907914
const auto &neckTurnToBallAndPlayer = action.neck_turn_to_ball_and_player();

0 commit comments

Comments
 (0)