Fixed issues in expcore

This commit is contained in:
Cooldude2606
2021-05-06 00:28:52 +01:00
parent a6a417b37b
commit 0c0dba384b
2 changed files with 6 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ end)
--- Admin Roles --- Admin Roles
Roles.new_role('System','SYS') Roles.new_role('System','SYS')
:set_permission_group('Admin') :set_permission_group('Default', true)
:set_flag('is_admin') :set_flag('is_admin')
:set_flag('is_spectator') :set_flag('is_spectator')
:set_flag('report-immune') :set_flag('report-immune')

View File

@@ -142,15 +142,15 @@ end
@tparam boolean state the state that you want to set it to, true = allow, false = disallow @tparam boolean state the state that you want to set it to, true = allow, false = disallow
@treturn Permissions_Groups._prototype returns self so function can be chained @treturn Permissions_Groups._prototype returns self so function can be chained
@usage-- Set an action to be disalowed @usage-- Set an action to be disallowed
group:set_action('toggle_map_editor', false) group:set_action('toggle_map_editor', false)
]] ]]
function Permissions_Groups._prototype:set_action(action, state) function Permissions_Groups._prototype:set_action(action, state)
if type(action) == 'string' then local input_action = defines.input_action[action]
action = defines.input_action[action] if input_action == nil then input_action = action end
end assert(type(input_action) == 'number', tostring(action)..' is not a valid input action')
self.actions[action] = state self.actions[input_action] = state
return self return self
end end