mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 04:21:41 +09:00
Added item return to spawn for corpes
This commit is contained in:
@@ -2,7 +2,7 @@ local Event = require 'utils.event'
|
||||
local Game = require 'utils.game'
|
||||
local Global = require 'utils.global'
|
||||
local config = require 'config.death_logger'
|
||||
local format_time = ext_require('expcore.common','format_time')
|
||||
local format_time,move_items = ext_require('expcore.common','format_time','move_items')
|
||||
|
||||
local deaths = {
|
||||
archive={} -- deaths moved here after body is gone
|
||||
@@ -78,6 +78,14 @@ if config.show_map_markers then
|
||||
end)
|
||||
end
|
||||
|
||||
if config.auto_collect_bodies then
|
||||
Event.add(defines.events.on_character_corpse_expired,function(event)
|
||||
local corpse = event.corpse
|
||||
local items = corpse.get_inventory(defines.inventory.character_corpse).get_contents()
|
||||
move_items(items,corpse.surface,{x=0,y=0})
|
||||
end)
|
||||
end
|
||||
|
||||
-- this is so other modules can access the logs
|
||||
return function()
|
||||
return deaths
|
||||
|
||||
Reference in New Issue
Block a user