public DateTime llMapDestination(string simname, LSL_Vector pos, LSL_Vector lookAt)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return DateTime.Now;
UUID avatarID = m_host.OwnerID;
DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_host.UUID, m_itemID, 0);
// only works on the first detected avatar
//This only works in touch events or if the item is attached to the avatar
if (detectedParams == null && !m_host.IsAttachment) return DateTime.Now;
if (detectedParams != null)
avatarID = detectedParams.Key;
IScenePresence avatar = World.GetScenePresence(avatarID);
if (avatar != null)
{
IMuteListModule module = m_host.ParentEntity.Scene.RequestModuleInterface<IMuteListModule>();
if (module != null)
{
bool cached = false; //Unneeded
#if (!ISWIN)
foreach (MuteList mute in module.GetMutes(avatar.UUID, out cached))
if (mute.MuteID == m_host.OwnerID)
return DateTime.Now;//If the avatar is muted, they don't get any contact from the muted av
#else
if (module.GetMutes(avatar.UUID, out cached).Any(mute => mute.MuteID == m_host.OwnerID))
{
return DateTime.Now;//If the avatar is muted, they don't get any contact from the muted av
}
#endif
}
avatar.ControllingClient.SendScriptTeleportRequest(m_host.Name, simname,
new Vector3((float)pos.x, (float)pos.y, (float)pos.z),
new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z));
}
return PScriptSleep(1000);
}