LuaSurface:can_place_entity seems to return always true. Trying to place by hand shows the rail in red, running the command returns true.
When i check with the position of an already placed rail, it's the same, seems to always be true, the good thing is, create_entity returns nil when trying to place a rail over another.
Command used (hard to see in the picture): /c game.player.print(serpent.dump(game.player.surface.can_place_entity{name="straight-rail", position={x=-203,y=7}}))[0.12] LuaSurface:can_place_entity always true
Re: [0.12] LuaSurface:can_place_entity always true
Might break resource spawning in RSO too - it will skip those it can't place but will wrongly think they were placed.
Re: [0.12] LuaSurface:can_place_entity always true
Does it act this way with other buildable entities or just rail?
Rail are special in that you can build them over each other when rotated so that may be the issue here.
Rail are special in that you can build them over each other when rotated so that may be the issue here.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.12] LuaSurface:can_place_entity always true
I didn't investigate further - it looks like it's working for RSO to check for ore and biters spawning. I didn't try to verify it in controlled way tho.
Re: [0.12] LuaSurface:can_place_entity always true
Seems to be only rails, tried it with a wooden-chest, with correct results.Rseding91 wrote:Does it act this way with other buildable entities or just rail?
Rail are special in that you can build them over each other when rotated so that may be the issue here.
As a side note: it also returns true when the position is over water, again only with rails.
Re: [0.12] LuaSurface:can_place_entity always true
Thanks for the report. This is now fixed for 0.12.1.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.12] LuaSurface:can_place_entity always true
That was quick, thank you