This commit is contained in:
ben-tk committed 2022-08-19 19:22:40 -04:00
1 parent fce16b6124
commit 59ca470898
1 file changed
+5 -4
+5 -4
View File
@@ -58,6 +58,11 @@ namespace CalamityMod.CalPlayer
for (int i = 0; i < Main.maxNPCs; i++)
{
NPC n = Main.npc[i];
// Ignore critters with the Guide to Critter Companionship
if (Player.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type])
continue;
if (n.active && !n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0)
{
if (hitArea.Intersects(n.getRect()) && (n.noTileCollide || Player.CanHit(n)))
@@ -69,10 +74,6 @@ namespace CalamityMod.CalPlayer
if (hitContext.Damage <= 0)
continue;
// Ignore critters with the Guide to Critter Companionship
if (Player.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type])
continue;
Player.ApplyDamageToNPC(n, hitContext.Damage, hitContext.KnockbackFactor, hitContext.HitDirection, hitContext.CriticalHit);
if (n.Calamity().dashImmunityTime[Player.whoAmI] < 12)
n.Calamity().dashImmunityTime[Player.whoAmI] = 12;