[0.18.19] Return value from spill_item_stack errors

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 181
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

[0.18.19] Return value from spill_item_stack errors

Post 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.
Attachments
ItemOnGroundTest_0.18.0.zip
spill_item_stack return value issue
(1.28 KiB) Downloaded 117 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13240
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.19] Return value from spill_item_stack errors

Post by Rseding91 »

Thanks for the report. It's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”