diff options
author | John Hurliman | 2009-10-23 01:02:36 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-23 01:02:36 -0700 |
commit | 588361e2a2398b963871762c2b5485c6a086cf47 (patch) | |
tree | 5be2c6705096817c599075da4e12a0e9b0a4c841 /OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs | |
parent | Added VS2010 support to Prebuild and created runprebuild2010.bat (diff) | |
download | opensim-SC_OLD-588361e2a2398b963871762c2b5485c6a086cf47.zip opensim-SC_OLD-588361e2a2398b963871762c2b5485c6a086cf47.tar.gz opensim-SC_OLD-588361e2a2398b963871762c2b5485c6a086cf47.tar.bz2 opensim-SC_OLD-588361e2a2398b963871762c2b5485c6a086cf47.tar.xz |
Experimental change to use an immutable array for iterating ScenePresences, avoiding locking and copying the list each time it is accessed
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index 9387bce..61b6d65 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs | |||
@@ -96,12 +96,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule | |||
96 | else | 96 | else |
97 | { | 97 | { |
98 | bool foundResult = false; | 98 | bool foundResult = false; |
99 | string resultstring = ""; | 99 | string resultstring = String.Empty; |
100 | List<ScenePresence> allav = DeadAvatar.Scene.GetScenePresences(); | 100 | ScenePresence[] allav = DeadAvatar.Scene.GetScenePresences(); |
101 | try | 101 | try |
102 | { | 102 | { |
103 | foreach (ScenePresence av in allav) | 103 | for (int i = 0; i < allav.Length; i++) |
104 | { | 104 | { |
105 | ScenePresence av = allav[i]; | ||
106 | |||
105 | if (av.LocalId == killerObjectLocalID) | 107 | if (av.LocalId == killerObjectLocalID) |
106 | { | 108 | { |
107 | av.ControllingClient.SendAlertMessage("You fragged " + DeadAvatar.Firstname + " " + DeadAvatar.Lastname); | 109 | av.ControllingClient.SendAlertMessage("You fragged " + DeadAvatar.Firstname + " " + DeadAvatar.Lastname); |