Page 1 of 1

LuaItemStack::create_blueprint always includes tile ghosts

Posted: Sun Jul 02, 2017 6:40 pm
by mickael9
When using LuaItemStack::create_blueprint() with always_include_tiles = false, tile ghosts are always included in the resulting blueprint, even if the area contains other entities. This doesn't happen when creating a blueprint manually over the same area.

Blueprint created via script:
create_blueprint.png
create_blueprint.png (111.83 KiB) Viewed 2189 times
Blueprint created manually:
manual_blueprint.png
manual_blueprint.png (146.3 KiB) Viewed 2189 times
Command used:

Code: Select all

/c p = game.player; pp = p.position; p.cursor_stack.set_stack('blueprint'); p.cursor_stack.create_blueprint{area = {{ pp.x - 5, pp.y - 5 }, { pp.x + 5, pp.y + 5 }}, surface = p.surface, force = p.force}

Re: LuaItemStack::create_blueprint always includes tile ghosts

Posted: Sun Jul 02, 2017 7:21 pm
by Rseding91
Thanks for the report. The standard blueprint "include tiles" logic was changed a while ago and the Lua interface hasn't been updated to operate the same way.

I can change it to work similar to the normal GUI does but it's going to cause any mods using the current system to break.

Re: LuaItemStack::create_blueprint always includes tile ghosts

Posted: Mon Jul 03, 2017 4:32 pm
by mickael9
Personally I would go with the change, unless there are other differences than just how tile ghosts are handled.
I don't think anyone should depend on this strange behavior since it's obviously a bug