Page 1 of 1

[0.18.19] Return value from spill_item_stack errors

Posted: Tue Apr 21, 2020 6:21 pm
by moon69
I can't figure out how to get the return values from LuaSurface.spill_item_stack.

These spill all the mags as expected...

Code: Select all

-- This spills mags and fills 'spilled' with the array of 50 entities as expected..
local spilled = player.surface.spill_item_stack(
	player.position,
	{ name = "firearm-magazine", count = 50 }
)

-- This spills mags as expected (but no return obviously)
player.surface.spill_item_stack(
	player.position,
	{ name = "firearm-magazine", count = 50 },
	true	
)
but having both an optional parameter and a return variable gives "attempt to index a boolean" error ???

Code: Select all

local badspill = player.surface.spill_item_stack(
	player.position,
	{ name = "firearm-magazine", count = 50 },
	true	
)
Attached is simple addon to repeat the issue - just start a new game and plop a stone-furnace or something down - mags will spill.
Mine the furnace and error will happen.

Re: [0.18.19] Return value from spill_item_stack errors

Posted: Tue Apr 21, 2020 8:15 pm
by Rseding91
Thanks for the report. It's now fixed for the next release.