From 2b8e488900625f8c487ca0cfc19f4bf4ca0a2921 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 1 Jun 2020 09:43:31 -0400 Subject: [PATCH] improved blood crawler counting loop --- Projectiles/Summon/BabyBloodCrawler.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Projectiles/Summon/BabyBloodCrawler.cs b/Projectiles/Summon/BabyBloodCrawler.cs index f5b91bd9d2..f0d3a1b2d4 100644 --- a/Projectiles/Summon/BabyBloodCrawler.cs +++ b/Projectiles/Summon/BabyBloodCrawler.cs @@ -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() && 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;