Only set the initial credits if the players role can own credits
This commit is contained in:
parent
f6aa4e97d8
commit
01fc562c5a
1 changed files with 6 additions and 1 deletions
|
@ -42,7 +42,12 @@ class TTTPlayer(player: Player, role: Role, val tttClass: TTTClassCompanion = TT
|
||||||
get() = player.walkSpeed
|
get() = player.walkSpeed
|
||||||
set(value) { player.walkSpeed = value }
|
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 boughtItems = mutableListOf<TTTItem<*>>()
|
||||||
|
|
||||||
val scoreboard = TTTScoreboard(this)
|
val scoreboard = TTTScoreboard(this)
|
||||||
|
|
Reference in a new issue