From 42318dc15afd238864b0e2075456fae32ad0a681 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 23 Oct 2007 14:22:20 +0000 Subject: * Fix for issue#514 - Sim crash when editing near terrain edge. --- OpenSim/Region/Environment/PermissionManager.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs index ab2ad8d..ac126c9 100644 --- a/OpenSim/Region/Environment/PermissionManager.cs +++ b/OpenSim/Region/Environment/PermissionManager.cs @@ -245,8 +245,20 @@ namespace OpenSim.Region.Environment if (GenericEstatePermission(user)) permission = true; + float X = position.X; + float Y = position.Y; + + if (X > 255) + X = 255; + if (Y > 255) + Y = 255; + if (X < 0) + X = 0; + if (Y < 0) + Y = 0; + // Land owner can terraform too - if (GenericParcelPermission(user, m_scene.LandManager.getLandObject(position.X, position.Y))) + if (GenericParcelPermission(user, m_scene.LandManager.getLandObject(X, Y))) permission = true; if (!permission) -- cgit v1.1