1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-01 13:08:05 +02:00

remove modifiers whenever a character is deleted

This commit is contained in:
Gerkiz 2021-05-24 18:20:29 +02:00
parent 7de1d62372
commit efc366c194

View File

@ -163,8 +163,18 @@ local function on_player_respawned(event)
Public.update_player_modifiers(game.players[event.player_index])
end
local function on_player_removed(event)
if this.modifiers[event.player_index] then
this.modifiers[event.player_index] = nil
end
if this.disabled_modifier[event.player_index] then
this.disabled_modifier[event.player_index] = nil
end
end
local Event = require 'utils.event'
Event.add(defines.events.on_player_joined_game, on_player_joined_game)
Event.add(defines.events.on_player_respawned, on_player_respawned)
Event.add(defines.events.on_player_removed, on_player_removed)
return Public