let objects use default animations

master
UbitUmarov 2020-06-02 18:05:22 +01:00
parent fde3727453
commit 8cebc84de7
1 changed files with 5 additions and 2 deletions

View File

@ -4195,7 +4195,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// Do NOT try to parse UUID, animations cannot be triggered by ID
UUID animID = ScriptUtils.GetAssetIdFromItemName(m_host, anim, (int)AssetType.Animation);
if (animID == UUID.Zero)
return;
animID = DefaultAvatarAnimations.GetDefaultAnimation(anim);
if (animID != UUID.Zero)
m_host.AddAnimation(animID, anim);
}
@ -4203,6 +4204,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
UUID animID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, anim, AssetType.Animation);
if (animID == UUID.Zero)
animID = DefaultAvatarAnimations.GetDefaultAnimation(anim);
if (animID != UUID.Zero)
m_host.RemoveAnimation(animID);
}