diff options
| author | historia <[not public]> | 2026-06-15 02:57:35 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-15 02:58:50 -0400 |
| commit | 4cc1ddcd185509080b4b3e15d1646567edd51c9d (patch) | |
| tree | 2a564846ad4fd159a2d7e55451bfa9569fe8c0b8 /internal/engine/tick.go | |
| parent | 445c4612cc5cf2c226f85894b6ad1e2419a374e2 (diff) | |
| download | thehouseoficarus-4cc1ddcd185509080b4b3e15d1646567edd51c9d.tar.gz | |
removed game speed for being broken and an antifeature anyway. added color support.
Diffstat (limited to 'internal/engine/tick.go')
| -rw-r--r-- | internal/engine/tick.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/internal/engine/tick.go b/internal/engine/tick.go index 419867d..7a422af 100644 --- a/internal/engine/tick.go +++ b/internal/engine/tick.go @@ -106,16 +106,12 @@ func (e *Engine) processTick() { } } -func FractionalTicks(base, speed float64) int { - if speed <= 0 { - speed = 1 +func ToTicks(base float64) int { + if base < 1 { + base = 1 } - value := base / speed - if value < 1 { - value = 1 - } - floor := int(value) - if rand.Float64() < value-float64(floor) { + floor := int(base) + if rand.Float64() < base-float64(floor) { return floor + 1 } return floor |
