From 92fde6ed268f4c7357ca5ad96b967db0f0658446 Mon Sep 17 00:00:00 2001 From: Talun Date: Fri, 4 May 2012 19:37:13 +0100 Subject: Mantis 60004 problems with damage and llSetDamage. In damage enabled areas this patch - Deletes any objects that have damage set > 0 that deliver that damage to an avatar Stops Gods receiving damage, Stops volume detect objects causing damage Deletes NPCS when their helth reduces to zero Gradually "heals" damage to an avatar Resets health on going to a non damage area --- .../Region/CoreModules/Avatar/Combat/CombatModule.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index 0babeb5..3a91465 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs @@ -96,6 +96,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule ScenePresence killingAvatar = null; // string killingAvatarMessage; + // check to see if it is an NPC and just remove it + INPCModule NPCmodule = deadAvatar.Scene.RequestModuleInterface(); + if (NPCmodule != null && NPCmodule.DeleteNPC(deadAvatar.UUID, deadAvatar.Scene)) + { + return; + } + if (killerObjectLocalID == 0) deadAvatarMessage = "You committed suicide!"; else @@ -145,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule catch (InvalidOperationException) { } - deadAvatar.Health = 100; + deadAvatar.setHealthWithUpdate(100.0f); deadAvatar.Scene.TeleportClientHome(deadAvatar.UUID, deadAvatar.ControllingClient); } @@ -154,14 +161,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule try { ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); - - if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) + if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0 + || avatar.Scene.RegionInfo.RegionSettings.AllowDamage) { avatar.Invulnerable = false; } else { avatar.Invulnerable = true; + if (avatar.Health < 100.0f) + { + avatar.setHealthWithUpdate(100.0f); + } } } catch (Exception) -- cgit v1.1 From 01b00ad0d57d828028379875a382965b44073497 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 5 May 2012 00:29:14 +0100 Subject: Fire the scripting changed event with CHANGED_OWNER when an object that has changed owners is rezzed. This needs to occur after the script is resumed rather than before, when the event is just dropped. Addresses http://opensimulator.org/mantis/view.php?id=5890 and http://opensimulator.org/mantis/view.php?id=5952 --- .../Avatar/Attachments/AttachmentsModule.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 7200c4b..2e1948d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -527,9 +527,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments private void AttachToAgent( IScenePresence sp, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent) { - // m_log.DebugFormat( - // "[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", - // so.Name, avatar.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos); +// m_log.DebugFormat( +// "[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", +// so.Name, sp.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos); so.DetachFromBackup(); @@ -788,9 +788,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments /// private void ShowAttachInUserInventory(IScenePresence sp, uint AttachmentPt, UUID itemID, SceneObjectGroup att) { - // m_log.DebugFormat( - // "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}", - // att.Name, sp.Name, AttachmentPt, itemID); +// m_log.DebugFormat( +// "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}", +// att.Name, sp.Name, AttachmentPt, itemID); if (UUID.Zero == itemID) { @@ -853,9 +853,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments private void Client_OnObjectAttach(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) { - // m_log.DebugFormat( - // "[ATTACHMENTS MODULE]: Attaching object local id {0} to {1} point {2} from ground (silent = {3})", - // objectLocalID, remoteClient.Name, AttachmentPt, silent); +// m_log.DebugFormat( +// "[ATTACHMENTS MODULE]: Attaching object local id {0} to {1} point {2} from ground (silent = {3})", +// objectLocalID, remoteClient.Name, AttachmentPt, silent); if (!Enabled) return; -- cgit v1.1