Can player reach entity?

Place to get help with not working mods / modding interface.
User avatar
Mango
Fast Inserter
Fast Inserter
Posts: 123
Joined: Fri Feb 22, 2013 6:27 pm
Contact:

Can player reach entity?

Post by Mango »

I can't find any function that would tell me if player can reach the entity he is pointing at.
Currently im using this:

Code: Select all

if player.reach_distance >= math.abs(entity.position.x - player.position.x) and
player.reach_distance >= math.abs(entity.position.y - player.position.y) then
is there any function doing this?
Hm.... so we have a mystery donor... intriguing.
Bilka
Factorio Staff
Factorio Staff
Posts: 3470
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Can player reach entity?

Post by Bilka »

I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Modding help”