mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-20 03:29:47 +02:00
Clear inv after town falls offline
This commit is contained in:
parent
6015439277
commit
6513afeea5
@ -84,6 +84,19 @@ function Public.requests(player)
|
||||
if this.requests[player.index] and this.requests[player.index] == 'kill-character' then
|
||||
if player.character then
|
||||
if player.character.valid then
|
||||
-- Clear inventories to avoid people easily getting back their stuff after a town dies offline
|
||||
local inventories = {
|
||||
player.get_inventory(defines.inventory.character_main),
|
||||
player.get_inventory(defines.inventory.character_guns),
|
||||
player.get_inventory(defines.inventory.character_ammo),
|
||||
player.get_inventory(defines.inventory.character_armor),
|
||||
player.get_inventory(defines.inventory.character_vehicle),
|
||||
player.get_inventory(defines.inventory.character_trash)
|
||||
}
|
||||
for _, i in pairs(inventories) do
|
||||
i.clear()
|
||||
end
|
||||
|
||||
player.character.die()
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user