Ejemplo n.º 1
0
        //This code prevents characters from saving while in the editor
        public void Save()
        {
            try
            {
                if (db != null)
                {
                    if (character != null)
                    {
                        entity.SaveToCharacter();
                        if (entity.Owner.Id != -6)
                            db.SaveCharacter(account, character);
                    }
                    db.Dispose();
                    db = null;
                }
                else
                {
                    db = new Database();
                    if (character != null)
                    {
                        entity.SaveToCharacter();
                        if (entity.Owner.Id != -6)
                            db.SaveCharacter(account, character);
                    }
                    db.Dispose();
                    db = null;
                }
            }
            catch
            {

            }
        }