From 9ad63c37a616e2b920fcdbc6d7fdc28cbcfae250 Mon Sep 17 00:00:00 2001 From: MarioE Date: Wed, 21 Jun 2017 01:21:32 -0400 Subject: [PATCH] Fix /spawnmob not spawning negative IDs again. --- TShockAPI/Commands.cs | 2 +- TShockAPI/TSServerPlayer.cs | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index ee9106fc..3b07ca75 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -2300,7 +2300,7 @@ namespace TShockAPI var npc = npcs[0]; if (npc.type >= 1 && npc.type < Main.maxNPCTypes && npc.type != 113) { - TSPlayer.Server.SpawnNPC(npc.type, npc.FullName, amount, args.Player.TileX, args.Player.TileY, 50, 20); + TSPlayer.Server.SpawnNPC(npc.netID, npc.FullName, amount, args.Player.TileX, args.Player.TileY, 50, 20); if (args.Silent) { args.Player.SendSuccessMessage("Spawned {0} {1} time(s).", npc.FullName, amount); diff --git a/TShockAPI/TSServerPlayer.cs b/TShockAPI/TSServerPlayer.cs index a1084d61..b811e9a8 100644 --- a/TShockAPI/TSServerPlayer.cs +++ b/TShockAPI/TSServerPlayer.cs @@ -152,12 +152,7 @@ namespace TShockAPI int spawnTileY; TShock.Utils.GetRandomClearTileWithInRange(startTileX, startTileY, tileXRange, tileYRange, out spawnTileX, out spawnTileY); - int npcid = NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, type, 0); - - // TODO: If special slimes break look at the git blame for this spot - // It's probably because I removed something that didn't work - Main.npc[npcid].SetDefaults(type); - + NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, type); } }