mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-23 23:53:44 +01:00
wea.eta: fix obscure edge case
This commit is contained in:
parent
2f5c1b759d
commit
9d76c5d98a
@ -32,10 +32,11 @@ function worldeditadditions.get_ms_time()
|
||||
end
|
||||
|
||||
function worldeditadditions.eta(existing_times, times_total_count)
|
||||
local max = 100
|
||||
local average = worldeditadditions.average(
|
||||
worldeditadditions.table_get_last(existing_times, 100)
|
||||
worldeditadditions.table_get_last(existing_times, max)
|
||||
)
|
||||
local times_left = times_total_count - #existing_times
|
||||
local times_left = times_total_count - math.min(100, #existing_times)
|
||||
if times_left == 0 then return 0 end
|
||||
return average * times_left
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user