Refactor the detectparams variable from 'd' to

a more meaningful name of 'detectedParams'.
0.6.1-post-fixes
Charles Krinke 2008-11-08 23:55:40 +00:00
parent ddca72530d
commit 83d83ebbc4
1 changed files with 30 additions and 30 deletions

View File

@ -792,55 +792,55 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llDetectedName(int number) public LSL_String llDetectedName(int number)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, number);
if (d == null) if (detectedParams == null)
return String.Empty; return String.Empty;
return d.Name; return detectedParams.Name;
} }
public LSL_String llDetectedKey(int number) public LSL_String llDetectedKey(int number)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, number);
if (d == null) if (detectedParams == null)
return String.Empty; return String.Empty;
return d.Key.ToString(); return detectedParams.Key.ToString();
} }
public LSL_String llDetectedOwner(int number) public LSL_String llDetectedOwner(int number)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, number);
if (d == null) if (detectedParams == null)
return String.Empty; return String.Empty;
return d.Owner.ToString(); return detectedParams.Owner.ToString();
} }
public LSL_Integer llDetectedType(int number) public LSL_Integer llDetectedType(int number)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, number);
if (d == null) if (detectedParams == null)
return 0; return 0;
return new LSL_Integer(d.Type); return new LSL_Integer(detectedParams.Type);
} }
public LSL_Vector llDetectedPos(int number) public LSL_Vector llDetectedPos(int number)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, number);
if (d == null) if (detectedParams == null)
return new LSL_Vector(); return new LSL_Vector();
return d.Position; return detectedParams.Position;
} }
public LSL_Vector llDetectedVel(int number) public LSL_Vector llDetectedVel(int number)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, number);
if (d == null) if (detectedParams == null)
return new LSL_Vector(); return new LSL_Vector();
return d.Velocity; return detectedParams.Velocity;
} }
public LSL_Vector llDetectedGrab(int number) public LSL_Vector llDetectedGrab(int number)
@ -856,19 +856,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Rotation llDetectedRot(int number) public LSL_Rotation llDetectedRot(int number)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, number);
if (d == null) if (detectedParams == null)
return new LSL_Rotation(); return new LSL_Rotation();
return d.Rotation; return detectedParams.Rotation;
} }
public LSL_Integer llDetectedGroup(int number) public LSL_Integer llDetectedGroup(int number)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, number); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, number);
if (d == null) if (detectedParams == null)
return new LSL_Integer(0); return new LSL_Integer(0);
if (m_host.GroupID == d.Group) if (m_host.GroupID == detectedParams.Group)
return new LSL_Integer(1); return new LSL_Integer(1);
return new LSL_Integer(0); return new LSL_Integer(0);
} }
@ -8057,10 +8057,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llMapDestination(string simname, LSL_Vector pos, LSL_Vector lookAt) public void llMapDestination(string simname, LSL_Vector pos, LSL_Vector lookAt)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
DetectParams d = m_ScriptEngine.GetDetectParams(m_itemID, 0); DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, 0);
if (d == null) return; // only works on the first detected avatar if (detectedParams == null) return; // only works on the first detected avatar
ScenePresence avatar = World.GetScenePresence(d.Key); ScenePresence avatar = World.GetScenePresence(detectedParams.Key);
if (avatar != null) if (avatar != null)
{ {
avatar.ControllingClient.SendScriptTeleportRequest(m_host.Name, simname, avatar.ControllingClient.SendScriptTeleportRequest(m_host.Name, simname,
@ -8428,10 +8428,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSL_List ret = new LSL_List(); LSL_List ret = new LSL_List();
if (land != null) if (land != null)
{ {
foreach (KeyValuePair<UUID, int> d in land.getLandObjectOwners()) foreach (KeyValuePair<UUID, int> detectedParams in land.getLandObjectOwners())
{ {
ret.Add(d.Key.ToString()); ret.Add(detectedParams.Key.ToString());
ret.Add(d.Value); ret.Add(detectedParams.Value);
} }
} }
// ScriptSleep(2000); // ScriptSleep(2000);