From 62b8c0a8d3577ce1dcb6a86fbaedb209f9a5fd46 Mon Sep 17 00:00:00 2001 From: Oxymoron Date: Sun, 1 May 2022 21:45:08 +0200 Subject: [PATCH] :bug: single primary constructor to set the default values correctly --- .../blxckoxymoron/paintball/game/config/GameConfig.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/crightgames/blxckoxymoron/paintball/game/config/GameConfig.kt b/src/main/java/de/crightgames/blxckoxymoron/paintball/game/config/GameConfig.kt index 8b7d3e0..91b30ba 100644 --- a/src/main/java/de/crightgames/blxckoxymoron/paintball/game/config/GameConfig.kt +++ b/src/main/java/de/crightgames/blxckoxymoron/paintball/game/config/GameConfig.kt @@ -10,7 +10,7 @@ import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.minutes import kotlin.time.Duration.Companion.seconds -class GameConfig() : ConfigurationSerializable { +class GameConfig(cfg: MutableMap = mutableMapOf()) : ConfigurationSerializable { /** * game, gameLoop, refill, respawn, shot, kill, timer, restart, regen @@ -29,7 +29,7 @@ class GameConfig() : ConfigurationSerializable { var noReplace = DefaultConfig.noReplace - constructor(cfg: MutableMap) : this() { + init { val cfgDurations = cfg["durations"] as? Map<*, *> ?: mapOf() val mappedDurs = DefaultConfig.durations +