Improved NPC spawning functionality via /sm.
Display names can now be used to find NPCs. Spawning by ID should now spawn unique NPCs, when multiple NPCs share the same name. Closes #1383
This commit is contained in:
parent
86c180c156
commit
90505435ba
2 changed files with 10 additions and 3 deletions
|
|
@ -153,7 +153,14 @@ namespace TShockAPI
|
|||
out spawnTileY);
|
||||
int npcid = NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, type, 0);
|
||||
// This is for special slimes
|
||||
Main.npc[npcid].SetDefaults(name);
|
||||
if (type == 1)
|
||||
{
|
||||
Main.npc[npcid].SetDefaults(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.npc[npcid].netDefaults(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue