if a move to target is set underground, constrain it to the terrain height
parent
61a931490d
commit
c678b75d65
|
@ -1635,7 +1635,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (LocalVectorToTarget3D.Y > 0) //MoveLeft
|
if (LocalVectorToTarget3D.Y > 0) //MoveLeft
|
||||||
{
|
{
|
||||||
m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT;
|
m_movementflag += (byte)(uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT;
|
||||||
//AgentControlFlags
|
|
||||||
AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT;
|
AgentControlFlags |= (uint)Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT;
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
|
@ -1704,6 +1703,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// pos.Z = AbsolutePosition.Z;
|
// pos.Z = AbsolutePosition.Z;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
float terrainHeight = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y];
|
||||||
|
pos.Z = Math.Max(terrainHeight, pos.Z);
|
||||||
|
|
||||||
m_moveToPositionInProgress = true;
|
m_moveToPositionInProgress = true;
|
||||||
MoveToPositionTarget = pos;
|
MoveToPositionTarget = pos;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue