Fixing spawn rates
This commit is contained in:
parent
95c1710b55
commit
95a066d145
2 changed files with 5 additions and 2 deletions
|
|
@ -421,7 +421,7 @@ namespace TShockAPI
|
||||||
public static void MaxSpawns(CommandArgs args)
|
public static void MaxSpawns(CommandArgs args)
|
||||||
{
|
{
|
||||||
int ply = args.PlayerID;
|
int ply = args.PlayerID;
|
||||||
int amount = 4;//Convert.ToInt32(args.Message.Remove(0, 10));
|
int amount = Convert.ToInt32(args.Message.Remove(0, 10));
|
||||||
int.TryParse(args.Message.Remove(0, 10), out amount);
|
int.TryParse(args.Message.Remove(0, 10), out amount);
|
||||||
NPC.maxSpawns = amount;
|
NPC.maxSpawns = amount;
|
||||||
Tools.Broadcast(Tools.FindPlayer(ply) + " changed the maximum spawns to: " + amount);
|
Tools.Broadcast(Tools.FindPlayer(ply) + " changed the maximum spawns to: " + amount);
|
||||||
|
|
@ -430,7 +430,7 @@ namespace TShockAPI
|
||||||
public static void SpawnRate(CommandArgs args)
|
public static void SpawnRate(CommandArgs args)
|
||||||
{
|
{
|
||||||
int ply = args.PlayerID;
|
int ply = args.PlayerID;
|
||||||
int amount = 700;//Convert.ToInt32(args.Message.Remove(0, 10));
|
int amount = Convert.ToInt32(args.Message.Remove(0, 10));
|
||||||
int.TryParse(args.Message.Remove(0, 10), out amount);
|
int.TryParse(args.Message.Remove(0, 10), out amount);
|
||||||
NPC.spawnRate = amount;
|
NPC.spawnRate = amount;
|
||||||
Tools.Broadcast(Tools.FindPlayer(ply) + " changed the spawn rate to: " + amount);
|
Tools.Broadcast(Tools.FindPlayer(ply) + " changed the spawn rate to: " + amount);
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,9 @@ namespace TShockAPI
|
||||||
kickBoom = cfg.KickExplosives;
|
kickBoom = cfg.KickExplosives;
|
||||||
spawnProtect = cfg.SpawnProtection;
|
spawnProtect = cfg.SpawnProtection;
|
||||||
spawnProtectRadius = cfg.SpawnProtectionRadius;
|
spawnProtectRadius = cfg.SpawnProtectionRadius;
|
||||||
|
|
||||||
|
Terraria.NPC.maxSpawns = defaultMaxSpawns;
|
||||||
|
Terraria.NPC.defaultSpawnRate = defaultSpawnRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void WriteJsonConfiguration()
|
public static void WriteJsonConfiguration()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue