Skip to content

Commit

Permalink
#587 Added ignore goal sizing flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shynixn committed Dec 20, 2024
1 parent 85ff6a9 commit 92cc5a8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ class CustomizationMeta{
* Should the players keep their health when they join a game?
*/
var keepHealthEnabled: Boolean = true

/**
* If set to true, the goal size can be arbitrary.
*/
var ignoreGoalSize: Boolean = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ class GameServiceImpl @Inject constructor(
}

private fun validateGoalSize(arena: SoccerArena, team: Team, teamMeta: TeamMeta) {
if (arena.meta.customizingMeta.ignoreGoalSize) {
return
}

if (abs(teamMeta.goal.upperCorner!!.x - teamMeta.goal.lowerCorner!!.x) < 1.8) {
throw SoccerGameException(
arena,
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/arena_sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ meta:
keepInventoryEnabled: false
# Should players keep their health when they join the game?
keepHealthEnabled: false
# If set to true, the goal size can be arbitrary.
ignoreGoalSize: false
# Settings for all types of games.
lobbyMeta:
# Max score a team can score before the game resets.
Expand Down

0 comments on commit 92cc5a8

Please sign in to comment.