mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-17 22:33:13 +09:00
Added item return to spawn for corpes
This commit is contained in:
1 parent
03dfcb46a7
commit
15bc0e033b
3 files changed
+16
-8
No files matched your search
@@ -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