aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-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}