Remove battle progress early return (#7469)

This commit is contained in:
2026-06-21 05:58:39 -07:00
committed by GitHub
parent 451e6bb406
commit 3ffeb0250b
@@ -547,26 +547,27 @@ case class HumanPlayerClientConnectionState(
def sendBattleProgress(
updatedBattles: Vector[ShardokBattleViewScala],
gatedRound: Int
): HumanPlayerClientConnectionState = {
if updatedBattles.isEmpty then return this
send(
UpdateStreamResponse(
responseDetails = UpdateStreamResponse.ResponseDetails.GameUpdate(
GameUpdate(
gameId = eagleGameId,
startingState = None,
gameUpdateDetails = GameUpdateDetails.BattleProgressResponse(
BattleProgressResponse(
updatedBattles = updatedBattles.map(ShardokBattleViewConverter.toProto),
currentDay = gatedRound
): HumanPlayerClientConnectionState =
if updatedBattles.isEmpty then this
else {
send(
UpdateStreamResponse(
responseDetails = UpdateStreamResponse.ResponseDetails.GameUpdate(
GameUpdate(
gameId = eagleGameId,
startingState = None,
gameUpdateDetails = GameUpdateDetails.BattleProgressResponse(
BattleProgressResponse(
updatedBattles = updatedBattles.map(ShardokBattleViewConverter.toProto),
currentDay = gatedRound
)
)
)
)
)
)
)
this
}
this
}
def sendBattleReset(
shardokGameId: ShardokGameId