1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-01-26 03:52:00 +02:00

Added item spill to force toggle #75

This commit is contained in:
Maik Wild 2017-09-30 18:40:06 +02:00
parent 7cf2001f3f
commit 706fdecaec

View File

@ -399,8 +399,12 @@ local function forcetoggle(cmd)
if name:match("power") or name:match("modular") then
local equips = inv[1].grid.equipment
for _,equip in pairs(equips) do
if equip.name == "personal-roboport-equipment" or equip.name == "personal-roboport-mk2-equipment" then
game.player.insert{name = equip.name}
if equip.name == "personal-roboport-equipment"
or equip.name == "personal-roboport-mk2-equipment"
or equip.name == "personal-laser-defense-equipment" then
if game.player.insert{name = equip.name} == 0 then
game.player.surface.spill_item_stack(game.player.position, {name = equip.name})
end
inv[1].grid.take(equip)
end
end