aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-10-17 01:42:31 +0100
committerJustin Clark-Casey (justincc)2011-10-17 01:42:31 +0100
commit0c041ce12f393367e2754e88d9b8dad5e45f88c4 (patch)
treeac02f32cda8bd7056e1ebbf0c037d9979d808d2b /OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
parentGuard HGAssetService against uninitialized variables and null arguments. (diff)
downloadopensim-SC_OLD-0c041ce12f393367e2754e88d9b8dad5e45f88c4.zip
opensim-SC_OLD-0c041ce12f393367e2754e88d9b8dad5e45f88c4.tar.gz
opensim-SC_OLD-0c041ce12f393367e2754e88d9b8dad5e45f88c4.tar.bz2
opensim-SC_OLD-0c041ce12f393367e2754e88d9b8dad5e45f88c4.tar.xz
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 :)
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index bcd9e94..be73639 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -199,6 +199,24 @@ namespace OpenSim.Region.OptionalModules.World.NPC
199 return false; 199 return false;
200 } 200 }
201 201
202 public bool Sit(UUID agentID, UUID partID, Scene scene)
203 {
204 lock (m_avatars)
205 {
206 if (m_avatars.ContainsKey(agentID))
207 {
208 ScenePresence sp;
209 scene.TryGetScenePresence(agentID, out sp);
210 sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero);
211 sp.HandleAgentSit(m_avatars[agentID], agentID);
212
213 return true;
214 }
215 }
216
217 return false;
218 }
219
202 public bool DeleteNPC(UUID agentID, Scene scene) 220 public bool DeleteNPC(UUID agentID, Scene scene)
203 { 221 {
204 lock (m_avatars) 222 lock (m_avatars)