From 56efe77e4addf29f749878da7fb256b47306eaee Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Sun, 12 Dec 2021 00:09:50 -0500 Subject: [PATCH] minor fixes --- Projectiles/Summon/ColdDivinityPointyThing.cs | 29 ++++++++++--------- Tiles/Abyss/HardenedSulphurousSandstone.cs | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Projectiles/Summon/ColdDivinityPointyThing.cs b/Projectiles/Summon/ColdDivinityPointyThing.cs index 74ecd0efd6..a5754a4c60 100644 --- a/Projectiles/Summon/ColdDivinityPointyThing.cs +++ b/Projectiles/Summon/ColdDivinityPointyThing.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Summon writer.Write(circling); writer.Write(circlingPlayer); writer.Write((double)floatyDistance); - writer.Write(target == null ? -1 : target.whoAmI); + writer.Write(target is null ? -1 : target.whoAmI); } public override void ReceiveExtraAI(BinaryReader reader) { @@ -114,18 +114,21 @@ namespace CalamityMod.Projectiles.Summon else if (projectile.ai[1] >= 2f && projectile.timeLeft > 900) { target = CalamityUtils.MinionHoming(projectile.Center, 1000f, Main.player[projectile.owner]); - projectile.timeLeft = 669; - projectile.ai[1]++; - circlingPlayer = false; - float height = target.getRect().Height; - float width = target.getRect().Width; - floatyDistance = MathHelper.Min((height > width ? height : width) * 3f, (Main.LogicCheckScreenWidth * Main.LogicCheckScreenHeight) / 2); - if (floatyDistance > Main.LogicCheckScreenWidth / 3) - floatyDistance = Main.LogicCheckScreenWidth / 3; - projectile.penetrate = -1; - projectile.usesIDStaticNPCImmunity = true; - projectile.idStaticNPCHitCooldown = 4; - projectile.netUpdate = true; + if (target != null) + { + projectile.timeLeft = 669; + projectile.ai[1]++; + circlingPlayer = false; + float height = target.getRect().Height; + float width = target.getRect().Width; + floatyDistance = MathHelper.Min((height > width ? height : width) * 3f, (Main.LogicCheckScreenWidth * Main.LogicCheckScreenHeight) / 2); + if (floatyDistance > Main.LogicCheckScreenWidth / 3) + floatyDistance = Main.LogicCheckScreenWidth / 3; + projectile.penetrate = -1; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 4; + projectile.netUpdate = true; + } } if (circlingPlayer) { diff --git a/Tiles/Abyss/HardenedSulphurousSandstone.cs b/Tiles/Abyss/HardenedSulphurousSandstone.cs index 5009eeb8b5..1be7d6246a 100644 --- a/Tiles/Abyss/HardenedSulphurousSandstone.cs +++ b/Tiles/Abyss/HardenedSulphurousSandstone.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Tiles.Abyss bool flag13 = false; for (int num52 = num8; num52 > num8 - 10; num52--) { - if (Main.tile[i, num52].bottomSlope()) + if (CalamityUtils.ParanoidTileRetrieval(i, num52).bottomSlope()) { flag13 = false; break;