TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ GetFirstNPCNameOrNull()

static string Terraria.NPC.GetFirstNPCNameOrNull ( int npcType)
inlinestatic

Returns the P:Terraria.NPC.GivenOrTypeName of the first active NPC of the given type in the world. If not found, null is returned.

Parameters
npcType
Returns

Definition at line 2364 of file NPC.cs.

2365 {
2366 for (int i = 0; i < 200; i++)
2367 {
2368 if (Main.npc[i].active && Main.npc[i].type == npcType)
2369 {
2370 return Main.npc[i].GivenOrTypeName;
2371 }
2372 }
2373 return null;
2374 }

References Terraria.Main.npc.

Referenced by Terraria.Lang.CreateDialogSubstitutionObject().

+ Here is the caller graph for this function: