a few code cosmetic changes
parent
7430c629aa
commit
b7ea5c4967
|
@ -991,32 +991,41 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
private void AvatarPlayAnimation(string avatar, string animation)
|
private void AvatarPlayAnimation(string avatar, string animation)
|
||||||
{
|
{
|
||||||
UUID avatarID = (UUID)avatar;
|
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
if (World.Entities.ContainsKey((UUID)avatar) && World.Entities[avatarID] is ScenePresence)
|
|
||||||
|
UUID avatarID;
|
||||||
|
if(!UUID.TryParse(avatar, out avatarID))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(!World.Entities.ContainsKey(avatarID))
|
||||||
|
return;
|
||||||
|
|
||||||
|
ScenePresence target = null;
|
||||||
|
if ((World.Entities[avatarID] is ScenePresence))
|
||||||
|
target = (ScenePresence)World.Entities[avatarID];
|
||||||
|
|
||||||
|
if (target == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
UUID animID = UUID.Zero;
|
||||||
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
ScenePresence target = (ScenePresence)World.Entities[avatarID];
|
if (inv.Value.Type == (int)AssetType.Animation)
|
||||||
if (target != null)
|
|
||||||
{
|
{
|
||||||
UUID animID=UUID.Zero;
|
if (inv.Value.Name == animation)
|
||||||
m_host.TaskInventory.LockItemsForRead(true);
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
animID = inv.Value.AssetID;
|
||||||
{
|
break;
|
||||||
if (inv.Value.Name == animation)
|
}
|
||||||
{
|
|
||||||
if (inv.Value.Type == (int)AssetType.Animation)
|
|
||||||
animID = inv.Value.AssetID;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_host.TaskInventory.LockItemsForRead(false);
|
|
||||||
if (animID == UUID.Zero)
|
|
||||||
target.Animator.AddAnimation(animation, m_host.UUID);
|
|
||||||
else
|
|
||||||
target.Animator.AddAnimation(animID, m_host.UUID);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
|
if (animID == UUID.Zero)
|
||||||
|
target.Animator.AddAnimation(animation, m_host.UUID);
|
||||||
|
else
|
||||||
|
target.Animator.AddAnimation(animID, m_host.UUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void osAvatarStopAnimation(string avatar, string animation)
|
public void osAvatarStopAnimation(string avatar, string animation)
|
||||||
|
|
Loading…
Reference in New Issue