diff options
author | alondria | 2008-01-12 04:30:47 +0000 |
---|---|---|
committer | alondria | 2008-01-12 04:30:47 +0000 |
commit | 90ccc248e81dcfa31c133a6b35f358dded602fa2 (patch) | |
tree | e16ee01adeb4e25ad93ed6042c89e4ef964bde59 /OpenSim | |
parent | * Added some of the finer control points to POS such as (diff) | |
download | opensim-SC-90ccc248e81dcfa31c133a6b35f358dded602fa2.zip opensim-SC-90ccc248e81dcfa31c133a6b35f358dded602fa2.tar.gz opensim-SC-90ccc248e81dcfa31c133a6b35f358dded602fa2.tar.bz2 opensim-SC-90ccc248e81dcfa31c133a6b35f358dded602fa2.tar.xz |
Implements llModifyLand() - Still needs some tweaking to match LL's effect on how much to effect the land.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs index b7fe241..1d9ca96 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs | |||
@@ -1382,6 +1382,65 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler | |||
1382 | 1382 | ||
1383 | public void llModifyLand(int action, int brush) | 1383 | public void llModifyLand(int action, int brush) |
1384 | { | 1384 | { |
1385 | double dsize; | ||
1386 | if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0))) | ||
1387 | { | ||
1388 | switch (brush) | ||
1389 | { | ||
1390 | case 1: | ||
1391 | dsize = 2; | ||
1392 | break; | ||
1393 | case 2: | ||
1394 | dsize = 4; | ||
1395 | break; | ||
1396 | case 3: | ||
1397 | dsize = 8; | ||
1398 | break; | ||
1399 | default: | ||
1400 | if (brush < 0) | ||
1401 | { | ||
1402 | dsize = (double)(-1 * brush); | ||
1403 | } | ||
1404 | else | ||
1405 | { | ||
1406 | LSLError("Invalid brush size"); | ||
1407 | dsize = 0; // Should cease execution, but get unassigned local variable dsize on compile. | ||
1408 | } | ||
1409 | break; | ||
1410 | } | ||
1411 | switch (action) | ||
1412 | { | ||
1413 | case 0: | ||
1414 | if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) < m_host.AbsolutePosition.Z) | ||
1415 | { | ||
1416 | World.Terrain.FlattenTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); | ||
1417 | } | ||
1418 | break; | ||
1419 | case 1: | ||
1420 | if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) < (double)m_host.AbsolutePosition.Z) | ||
1421 | { | ||
1422 | World.Terrain.RaiseTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 0.1); | ||
1423 | } | ||
1424 | break; | ||
1425 | case 2: | ||
1426 | if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) > 0) | ||
1427 | { | ||
1428 | World.Terrain.LowerTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); | ||
1429 | } | ||
1430 | break; | ||
1431 | case 3: | ||
1432 | World.Terrain.SmoothTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); | ||
1433 | break; | ||
1434 | case 4: | ||
1435 | World.Terrain.NoiseTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); | ||
1436 | break; | ||
1437 | case 5: | ||
1438 | World.Terrain.RevertTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); | ||
1439 | break; | ||
1440 | default: | ||
1441 | break; | ||
1442 | } | ||
1443 | } | ||
1385 | } | 1444 | } |
1386 | 1445 | ||
1387 | public void llCollisionSound(string impact_sound, double impact_volume) | 1446 | public void llCollisionSound(string impact_sound, double impact_volume) |