diff options
author | Melanie | 2012-08-14 21:37:30 +0200 |
---|---|---|
committer | Melanie | 2012-08-14 21:37:30 +0200 |
commit | 5546757931b849940c886acccaa53fd4a8abf567 (patch) | |
tree | 7dd8c334d7209102849740c83e629fdb1153e24e /OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |
parent | Removed more spammy NPC crap (diff) | |
parent | Merge branch 'careminster' into avination (diff) | |
download | opensim-SC_OLD-5546757931b849940c886acccaa53fd4a8abf567.zip opensim-SC_OLD-5546757931b849940c886acccaa53fd4a8abf567.tar.gz opensim-SC_OLD-5546757931b849940c886acccaa53fd4a8abf567.tar.bz2 opensim-SC_OLD-5546757931b849940c886acccaa53fd4a8abf567.tar.xz |
Merge branch 'avination' of ssh://3dhosting.de/var/git/careminster into avination
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 62 |
1 files changed, 29 insertions, 33 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 72853ea..cfedca9 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -177,16 +177,17 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
177 | if (m_avatars.ContainsKey(agentID)) | 177 | if (m_avatars.ContainsKey(agentID)) |
178 | { | 178 | { |
179 | ScenePresence sp; | 179 | ScenePresence sp; |
180 | scene.TryGetScenePresence(agentID, out sp); | 180 | if (scene.TryGetScenePresence(agentID, out sp)) |
181 | 181 | { | |
182 | // m_log.DebugFormat( | 182 | m_log.DebugFormat( |
183 | // "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", | 183 | "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", |
184 | // sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget); | 184 | sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget); |
185 | |||
186 | sp.MoveToTarget(pos, noFly, landAtTarget); | ||
187 | sp.SetAlwaysRun = running; | ||
188 | 185 | ||
189 | return true; | 186 | sp.MoveToTarget(pos, noFly, landAtTarget); |
187 | sp.SetAlwaysRun = running; | ||
188 | |||
189 | return true; | ||
190 | } | ||
190 | } | 191 | } |
191 | } | 192 | } |
192 | 193 | ||
@@ -200,12 +201,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
200 | if (m_avatars.ContainsKey(agentID)) | 201 | if (m_avatars.ContainsKey(agentID)) |
201 | { | 202 | { |
202 | ScenePresence sp; | 203 | ScenePresence sp; |
203 | scene.TryGetScenePresence(agentID, out sp); | 204 | if (scene.TryGetScenePresence(agentID, out sp)) |
204 | 205 | { | |
205 | sp.Velocity = Vector3.Zero; | 206 | sp.Velocity = Vector3.Zero; |
206 | sp.ResetMoveToTarget(); | 207 | sp.ResetMoveToTarget(); |
207 | 208 | ||
208 | return true; | 209 | return true; |
210 | } | ||
209 | } | 211 | } |
210 | } | 212 | } |
211 | 213 | ||
@@ -223,9 +225,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
223 | { | 225 | { |
224 | if (m_avatars.ContainsKey(agentID)) | 226 | if (m_avatars.ContainsKey(agentID)) |
225 | { | 227 | { |
226 | ScenePresence sp; | ||
227 | scene.TryGetScenePresence(agentID, out sp); | ||
228 | |||
229 | m_avatars[agentID].Say(channel, text); | 228 | m_avatars[agentID].Say(channel, text); |
230 | 229 | ||
231 | return true; | 230 | return true; |
@@ -241,9 +240,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
241 | { | 240 | { |
242 | if (m_avatars.ContainsKey(agentID)) | 241 | if (m_avatars.ContainsKey(agentID)) |
243 | { | 242 | { |
244 | ScenePresence sp; | ||
245 | scene.TryGetScenePresence(agentID, out sp); | ||
246 | |||
247 | m_avatars[agentID].Shout(channel, text); | 243 | m_avatars[agentID].Shout(channel, text); |
248 | 244 | ||
249 | return true; | 245 | return true; |
@@ -260,11 +256,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
260 | if (m_avatars.ContainsKey(agentID)) | 256 | if (m_avatars.ContainsKey(agentID)) |
261 | { | 257 | { |
262 | ScenePresence sp; | 258 | ScenePresence sp; |
263 | scene.TryGetScenePresence(agentID, out sp); | 259 | if (scene.TryGetScenePresence(agentID, out sp)) |
264 | sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero); | 260 | { |
265 | // sp.HandleAgentSit(m_avatars[agentID], agentID); | 261 | sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero); |
266 | 262 | // sp.HandleAgentSit(m_avatars[agentID], agentID); | |
267 | return true; | 263 | |
264 | return true; | ||
265 | } | ||
268 | } | 266 | } |
269 | } | 267 | } |
270 | 268 | ||
@@ -277,9 +275,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
277 | { | 275 | { |
278 | if (m_avatars.ContainsKey(agentID)) | 276 | if (m_avatars.ContainsKey(agentID)) |
279 | { | 277 | { |
280 | ScenePresence sp; | ||
281 | scene.TryGetScenePresence(agentID, out sp); | ||
282 | |||
283 | m_avatars[agentID].Whisper(channel, text); | 278 | m_avatars[agentID].Whisper(channel, text); |
284 | 279 | ||
285 | return true; | 280 | return true; |
@@ -296,10 +291,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
296 | if (m_avatars.ContainsKey(agentID)) | 291 | if (m_avatars.ContainsKey(agentID)) |
297 | { | 292 | { |
298 | ScenePresence sp; | 293 | ScenePresence sp; |
299 | scene.TryGetScenePresence(agentID, out sp); | 294 | if (scene.TryGetScenePresence(agentID, out sp)) |
300 | sp.StandUp(); | 295 | { |
296 | sp.StandUp(); | ||
301 | 297 | ||
302 | return true; | 298 | return true; |
299 | } | ||
303 | } | 300 | } |
304 | } | 301 | } |
305 | 302 | ||
@@ -312,6 +309,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
312 | { | 309 | { |
313 | if (m_avatars.ContainsKey(agentID)) | 310 | if (m_avatars.ContainsKey(agentID)) |
314 | return m_avatars[agentID].Touch(objectID); | 311 | return m_avatars[agentID].Touch(objectID); |
312 | |||
315 | return false; | 313 | return false; |
316 | } | 314 | } |
317 | } | 315 | } |
@@ -322,9 +320,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
322 | { | 320 | { |
323 | NPCAvatar av; | 321 | NPCAvatar av; |
324 | if (m_avatars.TryGetValue(agentID, out av)) | 322 | if (m_avatars.TryGetValue(agentID, out av)) |
325 | { | ||
326 | return av.OwnerID; | 323 | return av.OwnerID; |
327 | } | ||
328 | } | 324 | } |
329 | 325 | ||
330 | return UUID.Zero; | 326 | return UUID.Zero; |