Autobuild

by therax

Autobuild allows your character to automatically build, deconstruct, and upgrade nearby ghosts. A more efficient alternative to mods like Bluebuild.

Utilities
4 months ago
0.17 - 1.1
18.0K

b (fixed) Error when replacing tiles with full inventory

2 years ago

Die Mod Autobuild (0.5.0) hat einen Fehler verursacht, der nicht behoben werden kann.
Bitte informiere den Autor der Mod über diesen Fehler.

Error while running event autobuild::on_nth_tick(10)
autobuild/control.lua:215: attempt to index local 'entity' (a nil value)
stack traceback:
autobuild/control.lua:215: in function 'insert_or_spill'
autobuild/control.lua:231: in function 'try_revive_with_stack'
autobuild/control.lua:268: in function <autobuild/control.lua:265>
(...tail calls...)
autobuild/control.lua:375: in function 'do_autobuild'
autobuild/control.lua:470: in function 'handle_player_update'
autobuild/control.lua:476: in function <autobuild/control.lua:474>

Jodokus31 ☆
2 years ago
(updated 1 year, 8 months ago)

The replaced tile doesn't fit into the players inventory. So it tries to spill it to the ground.

local function insert_or_spill(player, entity, name, count)
  local inserted = player.insert{name=name, count=count}
  if inserted < count then
    entity.surface.spill_item_stack(entity.position, {name = name, count = count - inserted})
  end
end

But the problem is probably, that the tile has no position.
A possible fix could be to spill the items at players location instead. Or find another way to determine the position, where it should be spilled

Jodokus31 ☆
1 year, 6 months ago

This should be fixed with Version 0.5.3

New response