mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Fix region data loading to prevent deletion of telehub spawnpoints
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
This commit is contained in:
@@ -896,7 +896,7 @@ namespace OpenSim.Data.PGSQL
|
||||
public RegionSettings LoadRegionSettings(UUID regionUUID)
|
||||
{
|
||||
string sql = @"select * from regionsettings where ""regionUUID"" = :regionUUID";
|
||||
RegionSettings regionSettings;
|
||||
RegionSettings regionSettings = null;
|
||||
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
|
||||
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
|
||||
{
|
||||
@@ -908,10 +908,13 @@ namespace OpenSim.Data.PGSQL
|
||||
{
|
||||
regionSettings = BuildRegionSettings(reader);
|
||||
regionSettings.OnSave += StoreRegionSettings;
|
||||
|
||||
return regionSettings;
|
||||
}
|
||||
}
|
||||
if (regionSettings != null)
|
||||
{
|
||||
LoadSpawnPoints(regionSettings);
|
||||
return regionSettings;
|
||||
}
|
||||
}
|
||||
|
||||
//If we reach this point then there are new region settings for that region
|
||||
@@ -1970,14 +1973,14 @@ namespace OpenSim.Data.PGSQL
|
||||
conn.Open();
|
||||
using (NpgsqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
while (reader.Read())
|
||||
{
|
||||
SpawnPoint sp = new SpawnPoint();
|
||||
|
||||
sp.Yaw = (float)reader["Yaw"];
|
||||
sp.Pitch = (float)reader["Pitch"];
|
||||
sp.Distance = (float)reader["Distance"];
|
||||
|
||||
var sp = new SpawnPoint
|
||||
{
|
||||
Yaw = Convert.ToSingle(reader["Yaw"]),
|
||||
Pitch = Convert.ToSingle(reader["Pitch"]),
|
||||
Distance = Convert.ToSingle(reader["Distance"])
|
||||
};
|
||||
rs.AddSpawnPoint(sp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user