From 02e13ce7b146db1a3cee5b7cc963121009c60303 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 1 Jan 2019 17:04:24 +0000 Subject: [PATCH] Fixed More Bugs --- modules/ExpGamingAdmin/Commands/src/reports.lua | 7 ++++++- modules/ExpGamingAdmin/control.lua | 1 + modules/ExpGamingCore/Role/control.lua | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/ExpGamingAdmin/Commands/src/reports.lua b/modules/ExpGamingAdmin/Commands/src/reports.lua index e952737b..491fccb3 100644 --- a/modules/ExpGamingAdmin/Commands/src/reports.lua +++ b/modules/ExpGamingAdmin/Commands/src/reports.lua @@ -24,7 +24,12 @@ end) -- @command clear-reports -- @param player the player to clear the reports of commands.add_command('clear-reports', 'Clears a player\'s reports', { - ['player'] = {true,Admin.is_not_banned} + ['player'] = {true,function(value) + local player,err = commands.validate['player'](value) + if err then return commands.error(err) end + local rtn = not Admin.is_banned(player) and player + if not rtn then return commands.error{'ExpGamingAdmin.cant-report-ban',value} end return rtn + end} }, function(event,args) Admin.clear_reports(args.player,event.player_index) end) \ No newline at end of file diff --git a/modules/ExpGamingAdmin/control.lua b/modules/ExpGamingAdmin/control.lua index 5adc17c9..af576c94 100644 --- a/modules/ExpGamingAdmin/control.lua +++ b/modules/ExpGamingAdmin/control.lua @@ -6,6 +6,7 @@ -- Module Require local Game = require('FactorioStdLib.Game') +local Color = require('FactorioStdLib.Color') local Role -- ExpGamingCore.Role@^4.0.0 local Sync -- ExpGamingCore.Sync@^4.0.0 local Server -- ExpGamingCore.Server@^4.0.0 diff --git a/modules/ExpGamingCore/Role/control.lua b/modules/ExpGamingCore/Role/control.lua index 7391edad..52c30fd8 100644 --- a/modules/ExpGamingCore/Role/control.lua +++ b/modules/ExpGamingCore/Role/control.lua @@ -210,8 +210,9 @@ function Role.revert(player,by_player,count) for i = 1,count do local change = table.remove(changes) if not change then break end - if change[1] == 'assign' then Role.unassign(player,change[2],by_player,true) end - if change[1] == 'unassign' then Role.assign(player,change[2],by_player,true) end + local batch = is_type(change[2],'table') and change[2] or {change[2]} + if change[1] == 'assign' then Role.unassign(player,change[2],by_player,batch) end + if change[1] == 'unassign' then Role.assign(player,change[2],by_player,batch) end ctn=ctn+1 end return ctn @@ -285,7 +286,7 @@ function Role.print(role,rtn,colour,inv) local i = role.index while true do local _role = Role.get(i,true) - if not role then break end + if not _role then break end ctn=ctn+_role:print(message,colour) i=i+change end