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
0.6.5-rc1
idb 2009-04-02 10:24:12 +00:00
parent b42fec5c74
commit b45ac2bf8e
1 changed files with 17 additions and 17 deletions

View File

@ -1057,7 +1057,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if ((status & ScriptBaseClass.STATUS_PHYSICS) == ScriptBaseClass.STATUS_PHYSICS) if ((status & ScriptBaseClass.STATUS_PHYSICS) == ScriptBaseClass.STATUS_PHYSICS)
{ {
if (value == 1) if (value != 0)
{ {
SceneObjectGroup group = m_host.ParentGroup; SceneObjectGroup group = m_host.ParentGroup;
if (group == null) if (group == null)
@ -1082,7 +1082,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if ((status & ScriptBaseClass.STATUS_PHANTOM) == ScriptBaseClass.STATUS_PHANTOM) if ((status & ScriptBaseClass.STATUS_PHANTOM) == ScriptBaseClass.STATUS_PHANTOM)
{ {
if (value == 1) if (value != 0)
m_host.ScriptSetPhantomStatus(true); m_host.ScriptSetPhantomStatus(true);
else else
m_host.ScriptSetPhantomStatus(false); m_host.ScriptSetPhantomStatus(false);
@ -1115,7 +1115,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE) if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE)
{ {
if (value == 1) if (value != 0)
m_host.SetDieAtEdge(true); m_host.SetDieAtEdge(true);
else else
m_host.SetDieAtEdge(false); m_host.SetDieAtEdge(false);
@ -1972,15 +1972,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
//No energy force yet //No energy force yet
Vector3 v = new Vector3((float)force.x, (float)force.y, (float)force.z);
if (force.x > 20000) if (v.Length() > 20000.0f)
force.x = 20000; {
if (force.y > 20000) v.Normalize();
force.y = 20000; v = v * 20000.0f;
if (force.z > 20000) }
force.z = 20000; m_host.ApplyImpulse(v, local != 0);
m_host.ApplyImpulse(new Vector3((float)force.x, (float)force.y, (float)force.z), local != 0);
} }
public void llApplyRotationalImpulse(LSL_Vector force, int local) public void llApplyRotationalImpulse(LSL_Vector force, int local)
@ -2814,7 +2812,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (m_host.PhysActor != null) if (m_host.PhysActor != null)
{ {
PIDHoverType hoverType = PIDHoverType.Ground; PIDHoverType hoverType = PIDHoverType.Ground;
if (water == 1) if (water != 0)
{ {
hoverType = PIDHoverType.GroundAndWater; hoverType = PIDHoverType.GroundAndWater;
} }
@ -6425,10 +6423,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (!UUID.TryParse(map, out sculptId)) if (!UUID.TryParse(map, out sculptId))
{ {
llSay(0, "Could not parse key " + map); sculptId = InventoryKey(map, (int)AssetType.Texture);
return;
} }
if (sculptId == UUID.Zero)
return;
shapeBlock.ObjectLocalID = part.LocalId; shapeBlock.ObjectLocalID = part.LocalId;
shapeBlock.PathScaleX = 100; shapeBlock.PathScaleX = 100;
shapeBlock.PathScaleY = 150; shapeBlock.PathScaleY = 150;
@ -8860,7 +8860,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
else else
{ {
if (sim_wide == 1) if (sim_wide != 0)
{ {
if (category == 0) if (category == 0)
{ {
@ -8955,7 +8955,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 0; return 0;
} }
if (sim_wide == 1) if (sim_wide != 0)
{ {
decimal v = land.SimwideArea * (decimal)(0.22) * (decimal)bonusfactor; decimal v = land.SimwideArea * (decimal)(0.22) * (decimal)bonusfactor;