From 6ae1341c58fea31322cefca327ef672e651a27b1 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 7 Mar 2019 04:53:41 +0000 Subject: [PATCH] don't read from dbs wrong sound flags --- OpenSim/Data/MySQL/MySQLSimulationData.cs | 5 ++++- OpenSim/Data/PGSQL/PGSQLSimulationData.cs | 5 ++++- OpenSim/Data/SQLite/SQLiteSimulationData.cs | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index c5d7c47856..3db30d8647 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1403,7 +1403,10 @@ namespace OpenSim.Data.MySQL prim.Sound = DBGuid.FromDB(row["LoopedSound"].ToString()); prim.SoundGain = (float)(double)row["LoopedSoundGain"]; - prim.SoundFlags = 1; // If it's persisted at all, it's looped + if (prim.Sound != UUID.Zero) + prim.SoundFlags = 1; // If it's persisted at all, it's looped + else + prim.SoundFlags = 0; if (!(row["TextureAnimation"] is DBNull)) prim.TextureAnimation = (byte[])row["TextureAnimation"]; diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index 569cc806a0..99ceb914e9 100755 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs @@ -1742,7 +1742,10 @@ namespace OpenSim.Data.PGSQL prim.Sound = new UUID((Guid)primRow["LoopedSound"]); prim.SoundGain = Convert.ToSingle(primRow["LoopedSoundGain"]); - prim.SoundFlags = 1; // If it's persisted at all, it's looped + if (prim.Sound != UUID.Zero) + prim.SoundFlags = 1; // If it's persisted at all, it's looped + else + prim.SoundFlags = 0; if (!(primRow["TextureAnimation"] is DBNull)) prim.TextureAnimation = (Byte[])primRow["TextureAnimation"]; diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index e02ac7df2c..1403a8f8e5 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1742,7 +1742,10 @@ namespace OpenSim.Data.SQLite prim.Sound = new UUID(row["LoopedSound"].ToString()); prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]); - prim.SoundFlags = 1; // If it's persisted at all, it's looped + if (prim.Sound != UUID.Zero) + prim.SoundFlags = 1; // If it's persisted at all, it's looped + else + prim.SoundFlags = 0; if (!row.IsNull("TextureAnimation")) prim.TextureAnimation = Convert.FromBase64String(row["TextureAnimation"].ToString());