mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 19:45:22 +09:00
Added use chests as bodies
This commit is contained in:
@@ -58,6 +58,13 @@ end
|
||||
Event.add(defines.events.on_player_died,function(event)
|
||||
local player = Game.get_player_by_index(event.player_index)
|
||||
local corpse = player.surface.find_entity('character-corpse',player.position)
|
||||
if config.use_chests_as_bodies then
|
||||
local items = corpse.get_inventory(defines.inventory.character_corpse).get_contents()
|
||||
local chest = move_items(items,corpse.surface,corpse.position)
|
||||
chest.destructible = false
|
||||
corpse.destroy()
|
||||
corpse = chest
|
||||
end
|
||||
local death = {
|
||||
player_name = player.name,
|
||||
time_of_death = event.tick,
|
||||
|
||||
Reference in New Issue
Block a user