Implement osNpcSit(). This is still in development so don't trust it

Format is osNpcSit(<npc-uuid>, <target-uuid>, OS_NPC_SIT_IMMEDIATE)
e.g. osNpcSit(npc, llGetKey(), OS_NPC_SIT_IMMEDIATE);
At the moment, sit only succeeds if the part has a sit target set.
NPC immediately sits on the target even if miles away - they do not walk up to it.
This method is in development - it may change so please don't trust it yet.
Standing will follow shortly since that's kind of important once you're sitting :)
This commit is contained in:
Justin Clark-Casey (justincc)
2011-10-17 01:42:31 +01:00
parent bbd0e68c06
commit 0c041ce12f
10 changed files with 75 additions and 5 deletions

View File

@@ -199,6 +199,24 @@ namespace OpenSim.Region.OptionalModules.World.NPC
return false;
}
public bool Sit(UUID agentID, UUID partID, Scene scene)
{
lock (m_avatars)
{
if (m_avatars.ContainsKey(agentID))
{
ScenePresence sp;
scene.TryGetScenePresence(agentID, out sp);
sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero);
sp.HandleAgentSit(m_avatars[agentID], agentID);
return true;
}
}
return false;
}
public bool DeleteNPC(UUID agentID, Scene scene)
{
lock (m_avatars)