From 5dad5223e236bd066deea16b7b3cc07f3626eac8 Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Sat, 13 Apr 2024 18:41:38 +0200 Subject: [PATCH] Fix crash on non-admin member joining without being a faction member Resolves #24 Resolves #21 --- .../building_restrictions/set_player_permission_group.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/faction/building_restrictions/set_player_permission_group.lua b/module/faction/building_restrictions/set_player_permission_group.lua index 4772df1..7115595 100644 --- a/module/faction/building_restrictions/set_player_permission_group.lua +++ b/module/faction/building_restrictions/set_player_permission_group.lua @@ -9,7 +9,7 @@ local function set_player_permission_group(player) -- Get claiming faction local claiming_faction_id = global.gridworld.claiming_faction.faction_id local faction = get_player_faction(player) - if claiming_faction_id == faction.faction_id then + if 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