diff --git a/homeworld_logic.lua b/homeworld_logic.lua index de0cf01..891dd64 100644 --- a/homeworld_logic.lua +++ b/homeworld_logic.lua @@ -318,7 +318,7 @@ function Homeworld:tick( tick ) for player_index = 1, #game.players do local player = game.players[player_index] local held_item = player.cursor_stack - local holding_pda = (held_item.valid_for_read and held_item.name == pda_name) + local holding_pda = (held_item and held_item.valid_for_read and held_item.name == pda_name) if self.state.using_pda[player_index] and not holding_pda then self.state.using_pda[player_index] = nil self:hide_gui(player_index)