diff options
author | CasperW | 2009-11-23 19:51:40 +0100 |
---|---|---|
committer | CasperW | 2009-11-23 19:51:40 +0100 |
commit | 73c2162ff60850d96761aa07a1950dbbb2ec3e80 (patch) | |
tree | abdd139ca4d5b6e3588f56c7b21f6c82867fee8e /OpenSim/Region/CoreModules/Avatar/Chat | |
parent | Added some [DebuggerNonUserCode] modifiers to functions that throw EventAbort... (diff) | |
download | opensim-SC_OLD-73c2162ff60850d96761aa07a1950dbbb2ec3e80.zip opensim-SC_OLD-73c2162ff60850d96761aa07a1950dbbb2ec3e80.tar.gz opensim-SC_OLD-73c2162ff60850d96761aa07a1950dbbb2ec3e80.tar.bz2 opensim-SC_OLD-73c2162ff60850d96761aa07a1950dbbb2ec3e80.tar.xz |
Fixed nullrefs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Chat')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index cd59bdb..5c24f03 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -266,25 +266,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
266 | } | 266 | } |
267 | 267 | ||
268 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); | 268 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); |
269 | 269 | if (c.Scene != null) | |
270 | ((Scene)c.Scene).ForEachScenePresence( | 270 | { |
271 | delegate(ScenePresence presence) | 271 | ((Scene)c.Scene).ForEachScenePresence |
272 | { | 272 | ( |
273 | // ignore chat from child agents | 273 | delegate(ScenePresence presence) |
274 | if (presence.IsChildAgent) return; | 274 | { |
275 | 275 | // ignore chat from child agents | |
276 | IClientAPI client = presence.ControllingClient; | 276 | if (presence.IsChildAgent) return; |
277 | 277 | ||
278 | // don't forward SayOwner chat from objects to | 278 | IClientAPI client = presence.ControllingClient; |
279 | // non-owner agents | 279 | |
280 | if ((c.Type == ChatTypeEnum.Owner) && | 280 | // don't forward SayOwner chat from objects to |
281 | (null != c.SenderObject) && | 281 | // non-owner agents |
282 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | 282 | if ((c.Type == ChatTypeEnum.Owner) && |
283 | return; | 283 | (null != c.SenderObject) && |
284 | 284 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | |
285 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, | 285 | return; |
286 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | 286 | |
287 | }); | 287 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, |
288 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | ||
289 | } | ||
290 | ); | ||
291 | } | ||
288 | } | 292 | } |
289 | 293 | ||
290 | 294 | ||