1
0
Fork 0

Only set the initial credits if the players role can own credits

This commit is contained in:
Moritz Ruth 2020-06-19 17:57:41 +02:00
parent f6aa4e97d8
commit 01fc562c5a
No known key found for this signature in database
GPG key ID: AFD57E23E753841B

View file

@ -42,7 +42,12 @@ class TTTPlayer(player: Player, role: Role, val tttClass: TTTClassCompanion = TT
get() = player.walkSpeed
set(value) { player.walkSpeed = value }
var credits by Delegates.observable(Settings.initialCredits) { _, _, _ -> scoreboard.updateCredits() }
var credits = if (role.canOwnCredits) Settings.initialCredits else 0
set(value) {
field = value
scoreboard.updateCredits()
}
val boughtItems = mutableListOf<TTTItem<*>>()
val scoreboard = TTTScoreboard(this)