Skip to content

Commit

Permalink
Default to owner group in unclaimed servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielv123 committed Jun 16, 2024
1 parent 2c5ffba commit 502bc91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ local function set_player_permission_group(player)
return
end
-- Get claiming faction
local is_claimed = global.gridworld.claiming_faction.claimed
local claiming_faction_id = global.gridworld.claiming_faction.faction_id
local faction = get_player_faction(player)
if faction and claiming_faction_id == faction.faction_id then
if not is_claimed or faction and claiming_faction_id == faction.faction_id then
player.permission_group = game.permissions.get_group("Owner")
player.print("Setting permission group to Owner")
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ local function setup_permission_groups()
local owner = permission_groups.get_group("Owner") or permission_groups.create_group("Owner")
local guest = permission_groups.get_group("Guest") or permission_groups.create_group("Guest")

if not admin or not owner or not guest then
error("Failed to create permission groups")
end

-- Admins can do everything
admin.set_allows_action(defines.input_action.write_to_console, true)

Expand Down

0 comments on commit 502bc91

Please sign in to comment.