[0.12] LuaSurface:can_place_entity always true

This subforum contains all the issues which we already resolved.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

[0.12] LuaSurface:can_place_entity always true

Post by Choumiko »

LuaSurface:can_place_entity seems to return always true. Trying to place by hand shows the rail in red, running the command returns true.
mouse.jpg
mouse.jpg (253.66 KiB) Viewed 7768 times
can_place_entity.jpg
can_place_entity.jpg (193.57 KiB) Viewed 7768 times
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}}))
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.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by orzelek »

Might break resource spawning in RSO too - it will skip those it can't place but will wrongly think they were placed.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14319
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by Rseding91 »

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.
If you want to get ahold of me I'm almost always on Discord.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by orzelek »

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.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by Choumiko »

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.
Seems to be only rails, tried it with a wooden-chest, with correct results.
As a side note: it also returns true when the position is over water, again only with rails.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14319
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by Rseding91 »

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.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by Choumiko »

That was quick, thank you
Post Reply

Return to “Resolved Problems and Bugs”