Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions features/corpse_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,20 @@ local function mined_entity(event)
local corpse_owner = game.get_player(corpse_owner_index)
if player and corpse_owner then
local position = entity.position
Utils.action_warning('[Corpse]', { 'corpse.looted', player.name, corpse_owner.name, position.x, position.y, entity.surface.name })
local message = table.concat{
player.name,
' has looted ',
corpse_owner.name,
'\'s corpse.',
' [gps=',
string.format('%.1f', position.x),
',',
string.format('%.1f', position.y),
',',
entity.surface.name,
']'
}
Utils.action_warning('[Corpse]', message)
end
end

Expand Down Expand Up @@ -123,7 +136,20 @@ local function on_gui_opened(event)
local corpse_owner = game.get_player(corpse_owner_index)
if player and corpse_owner then
local position = entity.position
Utils.action_warning('[Corpse]', { 'corpse.looting', player.name, corpse_owner.name, position.x, position.y, entity.surface.name })
local message = table.concat{
player.name,
' is looting ',
corpse_owner.name,
'\'s corpse.',
' [gps=',
string.format('%.1f', position.x),
',',
string.format('%.1f', position.y),
',',
entity.surface.name,
']'
}
Utils.action_warning('[Corpse]', message)
end
end

Expand Down