aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorCharles Krinke2009-03-15 19:45:42 +0000
committerCharles Krinke2009-03-15 19:45:42 +0000
commit9e0329f1dc9c5853773c9b40336f98254c734141 (patch)
tree3f06e6402a7a30aa29171e6a78ae803fb3998195 /OpenSim/Region/ScriptEngine
parentFixes Mantis #3289. Thank you kindly, Ewe Loon, for a patch that: (diff)
downloadopensim-SC-9e0329f1dc9c5853773c9b40336f98254c734141.zip
opensim-SC-9e0329f1dc9c5853773c9b40336f98254c734141.tar.gz
opensim-SC-9e0329f1dc9c5853773c9b40336f98254c734141.tar.bz2
opensim-SC-9e0329f1dc9c5853773c9b40336f98254c734141.tar.xz
Fixes Mantis #3294. Thank you kindly, Godfrey, for a patch that:
Attached is a patch which provides osAvatarPlayAnimation() the ability to also trigger animations contained within the same prim as the script, as llStartAnimation() does. (It also modifies osAvatarStopAnimation(), otherwise the script wouldn't be able to stop animations it had started.)
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs42
1 files changed, 40 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 6b3afe0..f4be267 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -593,7 +593,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
593 if (World.Entities.ContainsKey((UUID)avatar) && World.Entities[avatarID] is ScenePresence) 593 if (World.Entities.ContainsKey((UUID)avatar) && World.Entities[avatarID] is ScenePresence)
594 { 594 {
595 ScenePresence target = (ScenePresence)World.Entities[avatarID]; 595 ScenePresence target = (ScenePresence)World.Entities[avatarID];
596 target.AddAnimation(animation, m_host.UUID); 596 if (target != null)
597 {
598 UUID animID=UUID.Zero;
599 lock (m_host.TaskInventory)
600 {
601 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
602 {
603 if (inv.Value.Name == animation)
604 {
605 if (inv.Value.Type == (int)AssetType.Animation)
606 animID = inv.Value.AssetID;
607 continue;
608 }
609 }
610 }
611 if (animID == UUID.Zero)
612 target.AddAnimation(animation, m_host.UUID);
613 else
614 target.AddAnimation(animID, m_host.UUID);
615 }
597 } 616 }
598 } 617 }
599 618
@@ -607,7 +626,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
607 if (World.Entities.ContainsKey(avatarID) && World.Entities[avatarID] is ScenePresence) 626 if (World.Entities.ContainsKey(avatarID) && World.Entities[avatarID] is ScenePresence)
608 { 627 {
609 ScenePresence target = (ScenePresence)World.Entities[avatarID]; 628 ScenePresence target = (ScenePresence)World.Entities[avatarID];
610 target.RemoveAnimation(animation); 629 if (target != null)
630 {
631 UUID animID=UUID.Zero;
632 lock (m_host.TaskInventory)
633 {
634 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
635 {
636 if (inv.Value.Name == animation)
637 {
638 if (inv.Value.Type == (int)AssetType.Animation)
639 animID = inv.Value.AssetID;
640 continue;
641 }
642 }
643 }
644 if (animID == UUID.Zero)
645 target.RemoveAnimation(animation);
646 else
647 target.RemoveAnimation(animID);
648 }
611 } 649 }
612 } 650 }
613 651