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

◆ SpawnAllowed_DyeTrader()

static bool Terraria.NPC.SpawnAllowed_DyeTrader ( )
inlinestatic

Definition at line 1962 of file NPC.cs.

1963 {
1965 {
1966 return true;
1967 }
1968 for (int i = 0; i < 255; i++)
1969 {
1970 Player player = Main.player[i];
1971 if (!player.active)
1972 {
1973 continue;
1974 }
1975 for (int j = 0; j < 58; j++)
1976 {
1977 Item item = player.inventory[j];
1978 if (item != null && item.stack > 0 && (item.dye > 0 || (item.type >= 1107 && item.type <= 1120) || (item.type >= 3385 && item.type <= 3388)))
1979 {
1980 return true;
1981 }
1982 }
1983 for (int k = 0; k < 10; k++)
1984 {
1985 Item item2 = player.dye[k];
1986 if (item2 != null && item2.stack > 0 && item2.dye > 0)
1987 {
1988 return true;
1989 }
1990 }
1991 for (int l = 0; l < 5; l++)
1992 {
1993 Item item3 = player.miscDyes[l];
1994 if (item3 != null && item3.stack > 0 && item3.dye > 0)
1995 {
1996 return true;
1997 }
1998 }
1999 }
2000 return false;
2001 }
static bool unlockedDyeTraderSpawn
Definition NPC.cs:768

References Terraria.Entity.active, Terraria.Item.dye, Terraria.Player.dye, Terraria.Player.inventory, Terraria.Player.miscDyes, Terraria.Main.player, Terraria.Item.stack, Terraria.Item.type, and Terraria.NPC.unlockedDyeTraderSpawn.

Referenced by Terraria.Main.UpdateTime_SpawnTownNPCs().

+ Here is the caller graph for this function: