aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2009-07-02 02:46:40 +0000
committerMelanie Thielker2009-07-02 02:46:40 +0000
commit412b555c27330de5cba17b958f46f23280c3f957 (patch)
treeeafd75c45744c0702d6b087ea5c2000316d45997 /OpenSim
parentFormatting cleanup. (diff)
downloadopensim-SC_OLD-412b555c27330de5cba17b958f46f23280c3f957.zip
opensim-SC_OLD-412b555c27330de5cba17b958f46f23280c3f957.tar.gz
opensim-SC_OLD-412b555c27330de5cba17b958f46f23280c3f957.tar.bz2
opensim-SC_OLD-412b555c27330de5cba17b958f46f23280c3f957.tar.xz
Restore some lost functionality tot he combat module. Code that used to
reside in the economy module was lost in the shuffle when that was moved to forge. Now it's where it belongs.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
index 456164a..171add8 100644
--- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs
@@ -9,7 +9,7 @@
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the 12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products 13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission. 14 * derived from this software without specific prior written permission.
15 * 15 *
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using Nini.Config; 30using Nini.Config;
31using OpenSim.Region.Framework.Interfaces; 31using OpenSim.Region.Framework.Interfaces;
32using OpenSim.Region.Framework.Scenes; 32using OpenSim.Region.Framework.Scenes;
33using OpenMetaverse;
33 34
34namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule 35namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
35{ 36{
@@ -67,6 +68,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
67 } 68 }
68 69
69 scene.EventManager.OnAvatarKilled += KillAvatar; 70 scene.EventManager.OnAvatarKilled += KillAvatar;
71 scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
70 } 72 }
71 73
72 public void PostInitialise() 74 public void PostInitialise()
@@ -140,5 +142,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
140 DeadAvatar.Health = 100; 142 DeadAvatar.Health = 100;
141 DeadAvatar.Scene.TeleportClientHome(DeadAvatar.UUID, DeadAvatar.ControllingClient); 143 DeadAvatar.Scene.TeleportClientHome(DeadAvatar.UUID, DeadAvatar.ControllingClient);
142 } 144 }
145
146 private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
147 {
148 ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
149 if ((obj.landData.Flags & (uint)Parcel.ParcelFlags.AllowDamage) != 0)
150 {
151 avatar.Invulnerable = false;
152 }
153 else
154 {
155 avatar.Invulnerable = true;
156 }
157 }
143 } 158 }
144} 159}