From ccf046e8e212753ffe2144e2133d558b380740c4 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 15 May 2007 20:44:14 +0000 Subject: fixed part of the bug from 116 (should no longer get the repeated Failed with exception System.IndexOutOfRangeException: Array index is out of range error) --- OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs') diff --git a/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index b886f46..d4515ca 100644 --- a/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs @@ -107,7 +107,10 @@ namespace OpenSim.Physics.BasicPhysicsPlugin } if(actor.Position.Z < (_heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X]+1)) {*/ - actor.Position.Z = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X]+1; + if (actor.Position.Y > 0 && actor.Position.Y < 256 && actor.Position.X > 0 && actor.Position.X < 256) + { + actor.Position.Z = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1; + } //} -- cgit v1.1