From 909796f6155e04c33c222234dfa773876ac912a9 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sun, 24 Feb 2008 17:46:28 +0000 Subject: Added limits to Prim.Position.X/Y/Z (0-255) so that your prims won't wander off into eternity --- OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs index 091f9d9..08f6009 100644 --- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs @@ -119,6 +119,10 @@ namespace OpenSim.Region.ScriptEngine.Common { Load(); Position.x += value; + if (Position.x > 255) + Position.x = 255; + if (Position.x < 0) + Position.x = 0; Save(); } } @@ -133,6 +137,10 @@ namespace OpenSim.Region.ScriptEngine.Common { Load(); Position.y += value; + if (Position.y > 255) + Position.y = 255; + if (Position.y < 0) + Position.y = 0; Save(); } } @@ -147,6 +155,10 @@ namespace OpenSim.Region.ScriptEngine.Common { Load(); Position.z += value; + if (Position.z > 255) + Position.z = 255; + if (Position.z < 0) + Position.z = 0; Save(); } } -- cgit v1.1