diff options
Diffstat (limited to 'OpenSim/Framework/Data.MySQL/MySQLDataStore.cs')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs index 06a5814..c48c88f 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | |||
@@ -702,12 +702,12 @@ namespace OpenSim.Framework.Data.MySQL | |||
702 | { | 702 | { |
703 | prim.SetSitTargetLL(new LLVector3( | 703 | prim.SetSitTargetLL(new LLVector3( |
704 | Convert.ToSingle(row["SitTargetOffsetX"]), | 704 | Convert.ToSingle(row["SitTargetOffsetX"]), |
705 | Convert.ToSingle(row["SitTargetOffsetX"]), | 705 | Convert.ToSingle(row["SitTargetOffsetY"]), |
706 | Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion( | 706 | Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion( |
707 | Convert.ToSingle(row["SitTargetOrientW"]), | ||
708 | Convert.ToSingle(row["SitTargetOrientX"]), | 707 | Convert.ToSingle(row["SitTargetOrientX"]), |
709 | Convert.ToSingle(row["SitTargetOrientY"]), | 708 | Convert.ToSingle(row["SitTargetOrientY"]), |
710 | Convert.ToSingle(row["SitTargetOrientX"]))); | 709 | Convert.ToSingle(row["SitTargetOrientZ"]), |
710 | Convert.ToSingle(row["SitTargetOrientW"]))); | ||
711 | } | 711 | } |
712 | catch (System.InvalidCastException) | 712 | catch (System.InvalidCastException) |
713 | { | 713 | { |
@@ -828,17 +828,30 @@ namespace OpenSim.Framework.Data.MySQL | |||
828 | row["RotationZ"] = prim.RotationOffset.Z; | 828 | row["RotationZ"] = prim.RotationOffset.Z; |
829 | row["RotationW"] = prim.RotationOffset.W; | 829 | row["RotationW"] = prim.RotationOffset.W; |
830 | 830 | ||
831 | // Sit target | 831 | try |
832 | LLVector3 sitTargetPos = prim.GetSitTargetPositionLL(); | 832 | { |
833 | row["SitTargetOffsetX"] = sitTargetPos.X; | 833 | // Sit target |
834 | row["SitTargetOffsetY"] = sitTargetPos.Y; | 834 | LLVector3 sitTargetPos = prim.GetSitTargetPositionLL(); |
835 | row["SitTargetOffsetZ"] = sitTargetPos.Z; | 835 | row["SitTargetOffsetX"] = sitTargetPos.X; |
836 | 836 | row["SitTargetOffsetY"] = sitTargetPos.Y; | |
837 | LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL(); | 837 | row["SitTargetOffsetZ"] = sitTargetPos.Z; |
838 | row["SitTargetOrientW"] = sitTargetOrient.W; | 838 | |
839 | row["SitTargetOrientX"] = sitTargetOrient.X; | 839 | LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL(); |
840 | row["SitTargetOrientY"] = sitTargetOrient.Y; | 840 | row["SitTargetOrientW"] = sitTargetOrient.W; |
841 | row["SitTargetOrientZ"] = sitTargetOrient.Z; | 841 | row["SitTargetOrientX"] = sitTargetOrient.X; |
842 | row["SitTargetOrientY"] = sitTargetOrient.Y; | ||
843 | row["SitTargetOrientZ"] = sitTargetOrient.Z; | ||
844 | } | ||
845 | catch (MySql.Data.MySqlClient.MySqlException) | ||
846 | { | ||
847 | // Database table was created before we got here and needs to be created! :P | ||
848 | |||
849 | using (MySqlCommand cmd = new MySqlCommand("ALTER TABLE `prims` ADD COLUMN `SitTargetOffsetX` float NOT NULL default 0, ADD COLUMN `SitTargetOffsetY` float NOT NULL default 0, ADD COLUMN `SitTargetOffsetZ` float NOT NULL default 0, ADD COLUMN `SitTargetOrientW` float NOT NULL default 0, ADD COLUMN `SitTargetOrientX` float NOT NULL default 0, ADD COLUMN `SitTargetOrientY` float NOT NULL default 0, ADD COLUMN `SitTargetOrientZ` float NOT NULL default 0;", m_connection)) | ||
850 | { | ||
851 | cmd.ExecuteNonQuery(); | ||
852 | } | ||
853 | } | ||
854 | |||
842 | 855 | ||
843 | } | 856 | } |
844 | 857 | ||