Skip to content

Commit

Permalink
Merge pull request #465 from Shynixn/development
Browse files Browse the repository at this point in the history
Merge changes to master --release
  • Loading branch information
Shynixn authored Sep 29, 2023
2 parents 03ac252 + 6eef4d4 commit 3a60d9e
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ class GameExecutionServiceImpl @Inject constructor(private val proxyService: Pro
* Applies points to the belonging teams when the given [player] dies in the given [game].
*/
override fun <P, G : Game> applyDeathPoints(game: G, player: P) {
val team = game.ingamePlayersStorage[player as Any]!!.team!!
require(player is Any)

if (!game.ingamePlayersStorage.containsKey(player)) {
return
}

val team = game.ingamePlayersStorage[player]!!.team

if (team == Team.RED) {
game.blueScore += game.arena.meta.blueTeamMeta.pointsPerEnemyDeath
Expand All @@ -51,7 +57,13 @@ class GameExecutionServiceImpl @Inject constructor(private val proxyService: Pro
* Lets the given [player] in the given [game] respawn at the specified spawnpoint.
*/
override fun <P, G : Game> respawn(game: G, player: P) {
val team = game.ingamePlayersStorage[player as Any]!!.goalTeam!!
require(player is Any)

if (!game.ingamePlayersStorage.containsKey(player)) {
return
}

val team = game.ingamePlayersStorage[player]!!.goalTeam

val teamMeta = if (team == Team.RED) {
game.arena.meta.redTeamMeta
Expand All @@ -65,4 +77,4 @@ class GameExecutionServiceImpl @Inject constructor(private val proxyService: Pro
proxyService.setPlayerLocation(player, teamMeta.spawnpoint!!)
}
}
}
}

0 comments on commit 3a60d9e

Please sign in to comment.