1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Make line_of_sight return blocking node position

This commit is contained in:
stujones11 2013-12-11 20:33:39 +00:00 committed by ShadowNinja
parent 33de69a173
commit d9ef072305
4 changed files with 16 additions and 6 deletions

View file

@ -354,7 +354,7 @@ ServerMap & ServerEnvironment::getServerMap()
return *m_map;
}
bool ServerEnvironment::line_of_sight(v3f pos1, v3f pos2, float stepsize)
bool ServerEnvironment::line_of_sight(v3f pos1, v3f pos2, float stepsize, v3s16 *p)
{
float distance = pos1.getDistanceFrom(pos2);
@ -372,6 +372,9 @@ bool ServerEnvironment::line_of_sight(v3f pos1, v3f pos2, float stepsize)
MapNode n = getMap().getNodeNoEx(pos);
if(n.param0 != CONTENT_AIR) {
if (p) {
*p = pos;
}
return false;
}
}