//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
            {

            }
        }