From 95a066d145062fc62db27995f2116a6d71a4ce35 Mon Sep 17 00:00:00 2001 From: Shank Date: Sat, 4 Jun 2011 20:28:29 -0600 Subject: [PATCH] Fixing spawn rates --- TShockAPI/Commands.cs | 4 ++-- TShockAPI/ConfigurationManager.cs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 599a27d8..fd2611a8 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -421,7 +421,7 @@ namespace TShockAPI public static void MaxSpawns(CommandArgs args) { 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); NPC.maxSpawns = amount; Tools.Broadcast(Tools.FindPlayer(ply) + " changed the maximum spawns to: " + amount); @@ -430,7 +430,7 @@ namespace TShockAPI public static void SpawnRate(CommandArgs args) { 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); NPC.spawnRate = amount; Tools.Broadcast(Tools.FindPlayer(ply) + " changed the spawn rate to: " + amount); diff --git a/TShockAPI/ConfigurationManager.cs b/TShockAPI/ConfigurationManager.cs index 980791fc..b23ef101 100644 --- a/TShockAPI/ConfigurationManager.cs +++ b/TShockAPI/ConfigurationManager.cs @@ -62,6 +62,9 @@ namespace TShockAPI kickBoom = cfg.KickExplosives; spawnProtect = cfg.SpawnProtection; spawnProtectRadius = cfg.SpawnProtectionRadius; + + Terraria.NPC.maxSpawns = defaultMaxSpawns; + Terraria.NPC.defaultSpawnRate = defaultSpawnRate; } public static void WriteJsonConfiguration()