improved blood crawler counting loop

This commit is contained in:
termigator1359 committed 2020-06-01 09:43:31 -04:00
1 parent 01816609db
commit 2b8e488900
1 file changed
+4 -1
+4 -1
View File
@@ -51,7 +51,10 @@ namespace CalamityMod.Projectiles.Summon
for (int j = 0; j < Main.maxProjectiles; j++)
{
Projectile proj = Main.projectile[j];
if (proj.active && proj.owner == projectile.owner && proj.type == ModContent.ProjectileType<BabyBloodCrawler>() && proj.Calamity().lineColor == 0)
// Short circuits to make the loop as fast as possible
if (!proj.active || proj.owner != projectile.owner || !proj.minion || proj.Calamity().lineColor != 0)
continue;
if (proj.type == projectile.type)
{
spiderCount += (int)proj.minionSlots;
proj.Calamity().lineColor = 1;