diff --git a/exp_scenario/module/gui/player_bonus.lua b/exp_scenario/module/gui/player_bonus.lua index b136495f..34abc22e 100644 --- a/exp_scenario/module/gui/player_bonus.lua +++ b/exp_scenario/module/gui/player_bonus.lua @@ -401,6 +401,9 @@ end --- @param player LuaPlayer function Elements.container.clear_player_bonus(player) Elements.container.data[player] = {} + if not player.character then + return + end for _, bonus_data in pairs(config.player_bonus) do if not bonus_data.is_special then player[bonus_data.name] = 0