Page 1 of 1

[0.17.79] LuaPlayer.cursor_ghost allows set to non-placeable item

Posted: Mon Jan 06, 2020 7:48 pm
by Jorn86
The mod api allows me to make a call like

Code: Select all

player.cursor_ghost = 'deconstruction-planner'
It runs as expected, putting a ghost of the planner in my cursor. Also as expected, planner ghosts don't actually work.

However, it doesn't show the ghost icon and there's no indication that the item in cursor is a ghost, causing confusion if one tries to use the planner.

Re: [0.17.79] LuaPlayer.cursor_ghost allows set to non-placeable item

Posted: Mon Jan 06, 2020 10:11 pm
by Rseding91
Thanks for the report. The ghost cursor logic doesn't have any checks on it by design: to keep it simple. Simply don't set it to things which are useless if you don't want it to be something useless :P

Re: [0.17.79] LuaPlayer.cursor_ghost allows set to non-placeable item

Posted: Tue Jan 07, 2020 8:24 am
by Jorn86
I figured that might be the solution :)

As a workaround, I'll check the place_result of the item and only set a ghost if it exists. Would I be missing anything that way?