Skip to content

Commit 478de7e

Browse files
committed
Fix no player character during bonus reset
1 parent 6bb26f6 commit 478de7e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

exp_scenario/module/gui/player_bonus.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,9 @@ end
401401
--- @param player LuaPlayer
402402
function Elements.container.clear_player_bonus(player)
403403
Elements.container.data[player] = {}
404+
if not player.character then
405+
return
406+
end
404407
for _, bonus_data in pairs(config.player_bonus) do
405408
if not bonus_data.is_special then
406409
player[bonus_data.name] = 0

0 commit comments

Comments
 (0)