From 85e18c5cccfa86e933ede130268c60bb370f49d6 Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Thu, 22 Aug 2024 19:05:55 +0100 Subject: [PATCH] fly overhead fix --- .../CombatExtended/Projectiles/ProjectileCE.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/CombatExtended/CombatExtended/Projectiles/ProjectileCE.cs b/Source/CombatExtended/CombatExtended/Projectiles/ProjectileCE.cs index 527b98cb34..5cdf7846d6 100644 --- a/Source/CombatExtended/CombatExtended/Projectiles/ProjectileCE.cs +++ b/Source/CombatExtended/CombatExtended/Projectiles/ProjectileCE.cs @@ -553,7 +553,7 @@ public virtual void Launch(Thing launcher, Vector2 origin, float shotAngle, floa this.lerpPosition = props.lerpPosition; this.GravityFactor = props.Gravity; } - if (shotHeight >= CollisionVertical.WallCollisionHeight && Position.Roofed(launcher.Map) && !def.projectile.flyOverhead) + if (shotHeight >= CollisionVertical.WallCollisionHeight && Position.Roofed(launcher.Map)) { ignoreRoof = true; } @@ -1200,6 +1200,11 @@ public override void Tick() { DangerTracker?.Notify_BulletAt(Position, def.projectile.damageAmountBase * dangerFactor); } + //If a flyoverhead ignore roof projectile is descending, enable roof check. + if (ignoreRoof && def.projectile.flyOverhead && shotAngle < 0) + { + ignoreRoof = false; + } } ///