Both with hand and robo. Version 1.2.5
Error while running event PowerOverload::on_pre_player_mined_item (ID 11)
LuaSurface doesn't contain key destroy.
stack traceback:
[C]: in function 'index'
__PowerOverload/scripts/transformer.lua:93: in function 'on_transformer_destroyed'
PowerOverload/control.lua:31: in function <PowerOverload/control.lua:28>
6962.870 Error ClientMultiplayerManager.cpp:99: MultiplayerManager failed: "The mod Power Overload (1.2.105) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event PowerOverload::on_pre_player_mined_item (ID 11)
LuaSurface doesn't contain key destroy.
stack traceback:
[C]: in function 'index'
__PowerOverload/scripts/transformer.lua:93: in function 'on_transformer_destroyed'
PowerOverload/control.lua:31: in function <PowerOverload/control.lua:28>"
code:
function on_transformer_destroyed(transformer)
local transformer_parts = global.transformers[transformer.unit_number]
if transformer_parts then
for name, entity in pairs(transformer_parts) do
if name ~= "transformer" then
-- If the transformer is destryed then the player won't get the item back
entity.destroy() <---here
end
end
end