Page 1 of 1

[Rseding] 0.17.74 - LuaSurface.set_tiles kills the player for no good reason

Posted: Mon Nov 04, 2019 9:35 am
by PyroFire
Image

/c local f=game.player.surface local p=game.player.position f.set_tiles{ {name="out-of-map",position={p.x,p.y+1}} }

Image

Why does this kill the player?
You can clearly see i'm standing in a valid position.

Re: [Rseding] 0.17.74 - LuaSurface.set_tiles kills the player for no good reason

Posted: Mon Nov 04, 2019 11:36 am
by Rseding91
If you turn on show-collision-rectangles and show-tile-grid you'll see that you're actually standing on the out-of-map tiles. So, when you call set_tiles the player collides with the out-of-map tiles and he gets killed as part of "remove entities that collide with the set tile".

I don't have a nice solution to this because player collision is different than everything else in that: the player can walk partially on tiles it collides with.

Re: [Rseding] 0.17.74 - LuaSurface.set_tiles kills the player for no good reason

Posted: Mon Nov 04, 2019 1:11 pm
by Rseding91
I'll let Posila know- I think he was the one who worked on the player walking logic so he might have some idea about if it's possible to address this.

Re: [Rseding] 0.17.74 - LuaSurface.set_tiles kills the player for no good reason

Posted: Mon Nov 04, 2019 2:32 pm
by mrvn
This also happens with waterfill mods. When you waterfill "below" the player you drown.