/setspawn settings no longer carry over to other worlds.
This commit is contained in:
parent
ce02cd1401
commit
96988fc7c9
3 changed files with 16 additions and 1 deletions
|
|
@ -56,6 +56,7 @@ namespace TShockAPI
|
||||||
|
|
||||||
public int spawnTileX;
|
public int spawnTileX;
|
||||||
public int spawnTileY;
|
public int spawnTileY;
|
||||||
|
public int Spawn_WorldID;
|
||||||
|
|
||||||
public bool RememberLeavePos = false;
|
public bool RememberLeavePos = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,10 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool ListServer = false;
|
public static bool ListServer = false;
|
||||||
|
|
||||||
|
public static int Spawn_WorldID;
|
||||||
|
public static int originalSpawnX;
|
||||||
|
public static int originalSpawnY;
|
||||||
|
|
||||||
public static void ReadJsonConfiguration()
|
public static void ReadJsonConfiguration()
|
||||||
{
|
{
|
||||||
TextReader tr = new StreamReader(FileTools.ConfigPath);
|
TextReader tr = new StreamReader(FileTools.ConfigPath);
|
||||||
|
|
@ -115,8 +119,11 @@ namespace TShockAPI
|
||||||
BackupInterval = cfg.BackupInterval;
|
BackupInterval = cfg.BackupInterval;
|
||||||
BackupKeepFor = cfg.BackupKeepFor;
|
BackupKeepFor = cfg.BackupKeepFor;
|
||||||
ListServer = cfg.ListServer;
|
ListServer = cfg.ListServer;
|
||||||
|
originalSpawnX = Main.spawnTileX;
|
||||||
|
originalSpawnY = Main.spawnTileY;
|
||||||
Main.spawnTileX = cfg.spawnTileX;
|
Main.spawnTileX = cfg.spawnTileX;
|
||||||
Main.spawnTileY = cfg.spawnTileY;
|
Main.spawnTileY = cfg.spawnTileY;
|
||||||
|
Spawn_WorldID = cfg.Spawn_WorldID;
|
||||||
RememberLeavePos = cfg.RememberLeavePos;
|
RememberLeavePos = cfg.RememberLeavePos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -155,7 +162,7 @@ namespace TShockAPI
|
||||||
cfg.spawnTileX = Main.spawnTileX;
|
cfg.spawnTileX = Main.spawnTileX;
|
||||||
cfg.spawnTileY = Main.spawnTileY;
|
cfg.spawnTileY = Main.spawnTileY;
|
||||||
cfg.RememberLeavePos = RememberLeavePos;
|
cfg.RememberLeavePos = RememberLeavePos;
|
||||||
|
cfg.Spawn_WorldID = Spawn_WorldID;
|
||||||
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
|
||||||
TextWriter tr = new StreamWriter(FileTools.ConfigPath);
|
TextWriter tr = new StreamWriter(FileTools.ConfigPath);
|
||||||
tr.Write(json);
|
tr.Write(json);
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,13 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ConfigurationManager.Spawn_WorldID != Main.worldID)
|
||||||
|
{
|
||||||
|
Main.spawnTileX = ConfigurationManager.originalSpawnX;
|
||||||
|
Main.spawnTileY = ConfigurationManager.originalSpawnY;
|
||||||
|
ConfigurationManager.Spawn_WorldID = Main.worldID;
|
||||||
|
}
|
||||||
|
|
||||||
Players[ply] = player;
|
Players[ply] = player;
|
||||||
Netplay.spamCheck = ConfigurationManager.SpamChecks;
|
Netplay.spamCheck = ConfigurationManager.SpamChecks;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue