minetest.line_of_sight wierdness

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

minetest.line_of_sight wierdness

by stu » Sun Nov 24, 2013 17:50

https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L1305
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.line_of_sight(pos1,pos2,stepsize) ->true/false
^ checkif there is a direct line of sight between pos1 and pos2


For some reason when I call this function it only ever returns the given stepsize or nil.
This seems strange since the only reference to it I can find is in environment.cpp

https://github.com/minetest/minetest/blob/master/src/environment.cpp#L357

This looks like it should indeed return true or false.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Nov 24, 2013 17:53

What Minetest version do you use?
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Nov 24, 2013 19:22

PilzAdam wrote:What Minetest version do you use?

It's a fairly recent build compiled just after kaeza's changes to player.lua model handling.
Will update to 0.4.8 soon but I don't see any changes to line_of_sight in environment.cpp
Last edited by stu on Sun Nov 24, 2013 19:23, edited 1 time in total.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Nov 24, 2013 19:26

stu wrote:
PilzAdam wrote:What Minetest version do you use?

It's a fairly recent build compiled just after kaeza's changes to player.lua model handling.
Will update to 0.4.8 soon but I don't see any changes to line_of_sight in environment.cpp

I remember that line_of_sight() was broken and got fixed, it also seems to work for me now.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Sun Nov 24, 2013 19:47

PilzAdam wrote:
stu wrote:
PilzAdam wrote:What Minetest version do you use?

It's a fairly recent build compiled just after kaeza's changes to player.lua model handling.
Will update to 0.4.8 soon but I don't see any changes to line_of_sight in environment.cpp

I remember that line_of_sight() was broken and got fixed, it also seems to work for me now.


line_of_sight() works for me, only the return value is not what is documented. I will update now and see if that changes anything.

Thanks.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Nov 24, 2013 22:59

It was sapier!
 

Iqualfragile
Member
 
Posts: 160
Joined: Tue Sep 18, 2012 22:11

by Iqualfragile » Mon Nov 25, 2013 00:55

Gr8 b8, m8. I rel8, str8 appreci8, and congratul8. I r8 this b8 an 8/8. Plz no h8, I'm str8 ir8. Cr8 more, can't w8. We should convers8, I won't ber8, my number is 8888888, ask for N8. No calls l8 or out of st8. If on a d8, ask K8 to loc8. Even with a full pl8, I always have time to communic8 so don't hesit8.
 


Return to Minetest Problems

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests

cron