Page 1 of 1

[0.13]LuaSurface.can_place_entity always true

Posted: Mon Jun 27, 2016 8:42 pm
by Choumiko
It seems like LuaSurface.can_place_entity is broken, as in always returning true:
The furnace in the image is at X=15 Y=1, using can_place_entity with a straight-rail at X=15Y=3 returns true, even though it*s in the water.
Image

[0.13.0] can_place_entity returns true on water

Posted: Mon Jun 27, 2016 9:28 pm
by orzelek
When calling can_place_entity for oil patch or enemy base/turret it will return true when checked entity location is on water.
You can check it with rso 2.0.0(attached) and following map string:

Code: Select all

>>>AAANAAAAXQADAwYAAAAEAAAAY29hbAMDAwoAAABjb3BwZXItb3Jl
AwMDCQAAAGNydWRlLW9pbAMDAwoAAABlbmVteS1iYXNlAwMDCAAAAGl
yb24tb3JlAwMDBQAAAHN0b25lAwMDYlx4VAAAAAAAAAAAAwDg/eeN<<
<
Enemy bases in bottom left corner will be placed on water - their placement is guarded by can_place_entity check in mod code (control.lua line 864).

Re: [0.13]LuaSurface.can_place_entity always true

Posted: Mon Jun 27, 2016 9:36 pm
by orzelek
Just reported it with rso also - tested on oil wells and biter bases there.

Re: [0.13.0] can_place_entity returns true on water

Posted: Wed Jun 29, 2016 3:04 pm
by Rseding91
Fixed in 0.13.1 with a test so it should stay fixed now :P