[0.12] LuaSurface:can_place_entity always true

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

[0.12] LuaSurface:can_place_entity always true

Post by Choumiko » Fri Jul 17, 2015 4:39 pm

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 4366 times
can_place_entity.jpg
can_place_entity.jpg (193.57 KiB) Viewed 4366 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: 3566
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by orzelek » Fri Jul 17, 2015 4:48 pm

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: 9246
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by Rseding91 » Fri Jul 17, 2015 5:49 pm

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: 3566
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by orzelek » Fri Jul 17, 2015 6:16 pm

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: 1277
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by Choumiko » Fri Jul 17, 2015 7:52 pm

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: 9246
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by Rseding91 » Sat Jul 18, 2015 3:59 am

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: 1277
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.12] LuaSurface:can_place_entity always true

Post by Choumiko » Sat Jul 18, 2015 7:36 am

That was quick, thank you

Post Reply

Return to “Resolved Problems and Bugs”

Who is online

Users browsing this forum: No registered users