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

◆ setNPCName()

static void Terraria.NPC.setNPCName ( string newName,
int npcType,
bool resetExtras = false )
inlinestatic

Definition at line 1513 of file NPC.cs.

1514 {
1515 bool flag = false;
1516 for (int i = 0; i < 200; i++)
1517 {
1518 if (!Main.npc[i].active || Main.npc[i].type != npcType)
1519 {
1520 continue;
1521 }
1522 if (flag)
1523 {
1524 Main.npc[i].GivenName = getNewNPCName(npcType);
1525 Main.npc[i].needsUniqueInfoUpdate = true;
1526 continue;
1527 }
1528 Main.npc[i].GivenName = newName;
1529 if (!resetExtras)
1530 {
1531 break;
1532 }
1533 flag = true;
1534 }
1535 }
static string getNewNPCName(int npcType)
Definition NPC.cs:1417

References Terraria.NPC.getNewNPCName(), and Terraria.Main.npc.

Referenced by Terraria.IO.WorldFile.LoadWorld_Version1_Old_BeforeRelease88().