diff options
author | idb | 2009-04-02 10:24:12 +0000 |
---|---|---|
committer | idb | 2009-04-02 10:24:12 +0000 |
commit | b45ac2bf8e55fc183d87edba3213662b6ccad7db (patch) | |
tree | 1247076a101f8135307291ff212cf6a2a81181bf /OpenSim/Region/ScriptEngine | |
parent | partial support for sculpted prim "inside out" setting (diff) | |
download | opensim-SC-b45ac2bf8e55fc183d87edba3213662b6ccad7db.zip opensim-SC-b45ac2bf8e55fc183d87edba3213662b6ccad7db.tar.gz opensim-SC-b45ac2bf8e55fc183d87edba3213662b6ccad7db.tar.bz2 opensim-SC-b45ac2bf8e55fc183d87edba3213662b6ccad7db.tar.xz |
Correct llSetPrimitiveParams to check for a texture in inventory when setting the sculpt map.
This Fixes Mantis #3331
Also corrected the capping calculation in llApplyImpulse and several integer "boolean" comparisons from "== 1" to "!= 0" for true
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b01a4aa..edaa3e9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -1057,7 +1057,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1057 | 1057 | ||
1058 | if ((status & ScriptBaseClass.STATUS_PHYSICS) == ScriptBaseClass.STATUS_PHYSICS) | 1058 | if ((status & ScriptBaseClass.STATUS_PHYSICS) == ScriptBaseClass.STATUS_PHYSICS) |
1059 | { | 1059 | { |
1060 | if (value == 1) | 1060 | if (value != 0) |
1061 | { | 1061 | { |
1062 | SceneObjectGroup group = m_host.ParentGroup; | 1062 | SceneObjectGroup group = m_host.ParentGroup; |
1063 | if (group == null) | 1063 | if (group == null) |
@@ -1082,7 +1082,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1082 | 1082 | ||
1083 | if ((status & ScriptBaseClass.STATUS_PHANTOM) == ScriptBaseClass.STATUS_PHANTOM) | 1083 | if ((status & ScriptBaseClass.STATUS_PHANTOM) == ScriptBaseClass.STATUS_PHANTOM) |
1084 | { | 1084 | { |
1085 | if (value == 1) | 1085 | if (value != 0) |
1086 | m_host.ScriptSetPhantomStatus(true); | 1086 | m_host.ScriptSetPhantomStatus(true); |
1087 | else | 1087 | else |
1088 | m_host.ScriptSetPhantomStatus(false); | 1088 | m_host.ScriptSetPhantomStatus(false); |
@@ -1115,7 +1115,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1115 | 1115 | ||
1116 | if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE) | 1116 | if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE) |
1117 | { | 1117 | { |
1118 | if (value == 1) | 1118 | if (value != 0) |
1119 | m_host.SetDieAtEdge(true); | 1119 | m_host.SetDieAtEdge(true); |
1120 | else | 1120 | else |
1121 | m_host.SetDieAtEdge(false); | 1121 | m_host.SetDieAtEdge(false); |
@@ -1972,15 +1972,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1972 | { | 1972 | { |
1973 | m_host.AddScriptLPS(1); | 1973 | m_host.AddScriptLPS(1); |
1974 | //No energy force yet | 1974 | //No energy force yet |
1975 | 1975 | Vector3 v = new Vector3((float)force.x, (float)force.y, (float)force.z); | |
1976 | if (force.x > 20000) | 1976 | if (v.Length() > 20000.0f) |
1977 | force.x = 20000; | 1977 | { |
1978 | if (force.y > 20000) | 1978 | v.Normalize(); |
1979 | force.y = 20000; | 1979 | v = v * 20000.0f; |
1980 | if (force.z > 20000) | 1980 | } |
1981 | force.z = 20000; | 1981 | m_host.ApplyImpulse(v, local != 0); |
1982 | |||
1983 | m_host.ApplyImpulse(new Vector3((float)force.x, (float)force.y, (float)force.z), local != 0); | ||
1984 | } | 1982 | } |
1985 | 1983 | ||
1986 | public void llApplyRotationalImpulse(LSL_Vector force, int local) | 1984 | public void llApplyRotationalImpulse(LSL_Vector force, int local) |
@@ -2814,7 +2812,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2814 | if (m_host.PhysActor != null) | 2812 | if (m_host.PhysActor != null) |
2815 | { | 2813 | { |
2816 | PIDHoverType hoverType = PIDHoverType.Ground; | 2814 | PIDHoverType hoverType = PIDHoverType.Ground; |
2817 | if (water == 1) | 2815 | if (water != 0) |
2818 | { | 2816 | { |
2819 | hoverType = PIDHoverType.GroundAndWater; | 2817 | hoverType = PIDHoverType.GroundAndWater; |
2820 | } | 2818 | } |
@@ -6425,10 +6423,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6425 | 6423 | ||
6426 | if (!UUID.TryParse(map, out sculptId)) | 6424 | if (!UUID.TryParse(map, out sculptId)) |
6427 | { | 6425 | { |
6428 | llSay(0, "Could not parse key " + map); | 6426 | sculptId = InventoryKey(map, (int)AssetType.Texture); |
6429 | return; | ||
6430 | } | 6427 | } |
6431 | 6428 | ||
6429 | if (sculptId == UUID.Zero) | ||
6430 | return; | ||
6431 | |||
6432 | shapeBlock.ObjectLocalID = part.LocalId; | 6432 | shapeBlock.ObjectLocalID = part.LocalId; |
6433 | shapeBlock.PathScaleX = 100; | 6433 | shapeBlock.PathScaleX = 100; |
6434 | shapeBlock.PathScaleY = 150; | 6434 | shapeBlock.PathScaleY = 150; |
@@ -8860,7 +8860,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8860 | 8860 | ||
8861 | else | 8861 | else |
8862 | { | 8862 | { |
8863 | if (sim_wide == 1) | 8863 | if (sim_wide != 0) |
8864 | { | 8864 | { |
8865 | if (category == 0) | 8865 | if (category == 0) |
8866 | { | 8866 | { |
@@ -8955,7 +8955,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8955 | return 0; | 8955 | return 0; |
8956 | } | 8956 | } |
8957 | 8957 | ||
8958 | if (sim_wide == 1) | 8958 | if (sim_wide != 0) |
8959 | { | 8959 | { |
8960 | decimal v = land.SimwideArea * (decimal)(0.22) * (decimal)bonusfactor; | 8960 | decimal v = land.SimwideArea * (decimal)(0.22) * (decimal)bonusfactor; |
8961 | 8961 | ||