mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-03-14 08:10:43 +01:00
Ceil values instead of floor when converting from percent to get better accuracy for low percentages
This commit is contained in:
parent
a1c003bd61
commit
73fd5ac828
@ -104,8 +104,8 @@ local function update_watermarks(pos, meta)
|
||||
local low_pct = meta:get_int("low_pct")
|
||||
local high_pct = meta:get_int("high_pct")
|
||||
|
||||
local low = math.floor(i_size * (low_pct / 100.0))
|
||||
local high = math.floor(i_size * (high_pct / 100.0))
|
||||
local low = math.ceil(i_size * (low_pct / 100.0))
|
||||
local high = math.ceil(i_size * (high_pct / 100.0))
|
||||
|
||||
-- We want watermark % > 0 to enable output if a single slot has items
|
||||
-- regardless of inventory size so add 1 here if needed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user