From 86df190bee91eb38038a39b98448dd1623db1b6f Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 23 Dec 2009 00:25:32 +0100 Subject: Fixing limiter. --- dalos-limiter.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dalos-limiter.lua b/dalos-limiter.lua index b8387e3..5badfbb 100644 --- a/dalos-limiter.lua +++ b/dalos-limiter.lua @@ -19,7 +19,7 @@ Limit: %i{The actual size this limiter is going to produce} self.color = cd.GREEN local obj = { h = h, - size = math.max(h:getsize(), self.limit), + size = math.min(h:getsize(), self.extra.limit), getname = function () return self.name end, do_read = function (self, count, userdata) return self.h:read(count, userdata) @@ -47,7 +47,8 @@ Limit: %i{The actual size this limiter is going to produce} tab.ntype = "Limiter" tab.get_settings = dalosp.limiter.get_settings local extra = { } - if settings then extra.limit = settings.limit end + if not settings then settings = {} end + extra.limit = settings.limit or 0 local obj = dalos.object(d, tab, extra) -- cgit v1.2.3