internal static int ReserveNPCID()
{
if (ModNet.AllowVanillaClients) throw new Exception("Adding npcs breaks vanilla client compatiblity");
int reserveID = nextNPC;
nextNPC++;
return reserveID;
}
public void AddNPC(string name, ModNPC npc, string texture) { int id = NPCLoader.ReserveNPCID(); npc.npc.name = name; npc.npc.type = id; npcs[name] = npc; NPCLoader.npcs[id] = npc; npc.texture = texture; npc.mod = this; }