mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 19:05:02 -04:00
sounds: check if total weight >= 1, #63
This commit is contained in:
parent
543dda505a
commit
1bfb4aff68
@ -35,6 +35,7 @@ class WeightedBakedModel(
|
||||
totalWeight += weight
|
||||
}
|
||||
|
||||
check(totalWeight > 0) { "Weight must be >= 1" }
|
||||
this.totalWeight = totalWeight
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ data class SoundType(
|
||||
totalWeight += sound.weight
|
||||
}
|
||||
|
||||
check(totalWeight >= 1) { "Weight must be >= 1" }
|
||||
this.totalWeight = totalWeight
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user