Skip to content

Commit

Permalink
Fix crash on faction server status draw when not part of a faction
Browse files Browse the repository at this point in the history
Resolves #25
  • Loading branch information
Danielv123 committed Apr 13, 2024
1 parent 5dad522 commit f6e4325
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion module/faction/gui/faction_server_status/draw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ local function draw_faction_server_status(player)
if player == nil then return false end

local player_faction = get_player_faction(player)
local faction_id = player_faction.faction_id
local faction_id = nil
if player_faction ~= nil then
faction_id = player_faction.faction_id
end
local server_is_claimed = global.gridworld.claiming_faction.claimed
local claiming_faction = get_faction(global.gridworld.claiming_faction.faction_id)
local server_is_claimed_by_player = server_is_claimed and global.gridworld.claiming_faction.faction_id == faction_id
Expand Down

0 comments on commit f6e4325

Please sign in to comment.