Fixing spawn rates

This commit is contained in:
Shank 2011-06-04 20:28:29 -06:00
parent 95c1710b55
commit 95a066d145
2 changed files with 5 additions and 2 deletions

View file

@ -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);

View file

@ -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()