Example #1
0
        public StateSave FindScriptStateSave(ScriptData script)
        {
            OSDMap component = m_manager.GetComponentState(script.Part, m_componentName) as OSDMap;

            //Attempt to find the state saves we have
            if (component != null)
            {
                OSD o;
                //If we have one for this item, deserialize it
                if (!component.TryGetValue(script.ItemID.ToString(), out o))
                {
                    if (!component.TryGetValue(script.InventoryItem.OldItemID.ToString(), out o))
                    {
                        if (!component.TryGetValue(script.InventoryItem.ItemID.ToString(), out o))
                        {
                            return(null);
                        }
                    }
                }
                StateSave save = new StateSave();
                save.FromOSD((OSDMap)o);
                return(save);
            }
            return(null);
        }