[2.0.73] LuaRenderObject::players writing empty table yields visible renderobject

Bugs that are actually features.
blueblue
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Tue Apr 11, 2017 7:39 pm
Contact:

[2.0.73] LuaRenderObject::players writing empty table yields visible renderobject

Post by blueblue »

When you set the players that can see the object to empty the object should be invisible. Same with forces.

Reproduce: In a new game, run the command

Code: Select all

/c local line = rendering.draw_line{from = {0,0}, to = game.player.character, color = {}, surface = game.player.surface, width = 4}; line.players = {}
Expected Result: No line should be invisible. Observed result: Line is visible.
unique_2 on discord and mod portal
Rseding91
Factorio Staff
Factorio Staff
Posts: 16551
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.73] LuaRenderObject::players writing empty table yields visible renderobject

Post by Rseding91 »

Thanks for the report however this is not a bug. The documentation specifically mentions this is how it works. If you don't want a line to render for any player - set it to visible = false or destroy it and create it at a later time.
If you want to get ahold of me I'm almost always on Discord.
Bilka
Factorio Staff
Factorio Staff
Posts: 3697
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [2.0.73] LuaRenderObject::players writing empty table yields visible renderobject

Post by Bilka »

I noticed that this was documented on the various draw_* methods but not LuaRenderObject itself, so I've adjusted the LuaRenderObject documentation for the next release.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Not a bug”