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.
trunk
Melanie Thielker 2009-07-02 02:46:40 +00:00
parent 1d01d6d919
commit 412b555c27
1 changed files with 16 additions and 1 deletions

View File

@ -9,7 +9,7 @@
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
@ -30,6 +30,7 @@ using System.Collections.Generic;
using Nini.Config;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenMetaverse;
namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
{
@ -67,6 +68,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
}
scene.EventManager.OnAvatarKilled += KillAvatar;
scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
}
public void PostInitialise()
@ -140,5 +142,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
DeadAvatar.Health = 100;
DeadAvatar.Scene.TeleportClientHome(DeadAvatar.UUID, DeadAvatar.ControllingClient);
}
private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
{
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
if ((obj.landData.Flags & (uint)Parcel.ParcelFlags.AllowDamage) != 0)
{
avatar.Invulnerable = false;
}
else
{
avatar.Invulnerable = true;
}
}
}
}