From: Mark Kretschmann Date: Tue, 1 Aug 2006 12:26:40 +0000 (+0000) Subject: Fix the "list" function. Now counts the pages correctly. X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=2c691f2dc9e6e3e1571218a6ad9c131359d37ffd;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git Fix the "list" function. Now counts the pages correctly. --- diff --git a/data/rbot/plugins/script.rb b/data/rbot/plugins/script.rb index 8234442c..171dabcb 100644 --- a/data/rbot/plugins/script.rb +++ b/data/rbot/plugins/script.rb @@ -112,7 +112,7 @@ class ScriptPlugin < Plugin cmds_per_page = 30 cmds = @commands.keys.sort - num_pages = cmds.length / cmds_per_page + num_pages = cmds.length / cmds_per_page + 1 page = params[:page].to_i page = [page, 1].max page = [page, num_pages].min