Fixed bug with nil index for decon

This commit is contained in:
Cooldude2606
2020-08-16 17:45:04 +01:00
parent 1172baf2b9
commit e3a0376b30

View File

@@ -17,6 +17,7 @@ end)
Event.add(defines.events.on_marked_for_deconstruction, function(event)
-- Check which type of decon a player is allowed
local index = event.player_index
if not index then return end
if chache[index] == nil then
local player = game.players[index]
if Roles.player_allowed(player, 'fast-tree-decon') then chache[index] = 'fast'