* Fixed compile issue caused by half-refactoring (sorrry!)

afrisby
Adam Frisby 2007-12-27 05:48:27 +00:00
parent cbf5ff4a93
commit 2cb222806b
1 changed files with 12 additions and 1 deletions

View File

@ -2878,6 +2878,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
// //
public int osTerrainSetHeight(int x, int y, double val) public int osTerrainSetHeight(int x, int y, double val)
{ {
if (x > 255 || x < 0 || y > 255 || y < 0)
LSLError("osTerrainSetHeight: Coordinate out of bounds");
if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(x, y, 0))) if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(x, y, 0)))
{ {
World.Terrain.Set(x, y, val); World.Terrain.Set(x, y, val);
@ -2891,6 +2894,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
public double osTerrainGetHeight(int x, int y) public double osTerrainGetHeight(int x, int y)
{ {
if (x > 255 || x < 0 || y > 255 || y < 0)
LSLError("osTerrainGetHeight: Coordinate out of bounds");
return World.Terrain.GetHeight(x, y); return World.Terrain.GetHeight(x, y);
} }
@ -2898,7 +2904,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
{ {
if (World.PermissionsMngr.CanRestartSim(m_host.OwnerID)) if (World.PermissionsMngr.CanRestartSim(m_host.OwnerID))
{ {
World.Restart((float)ms); World.Restart((float)seconds);
return 1; return 1;
} }
else else
@ -2936,5 +2942,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
if (throwErrorOnNotImplemented) if (throwErrorOnNotImplemented)
throw new NotImplementedException("Command not implemented: " + Command); throw new NotImplementedException("Command not implemented: " + Command);
} }
private void LSLError(string msg)
{
throw new Exception("LSL Runtime Error: " + msg);
}
} }
} }