From 5e2cac78ac8c4169abd5bd2aa79bc7a0bd4734e1 Mon Sep 17 00:00:00 2001 From: py01 <60152240+collinlunn@users.noreply.github.com> Date: Tue, 3 Mar 2020 08:09:07 -0600 Subject: [PATCH] Fixes melee/hitscan raycast through airlocks (#777) --- .../GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs | 2 +- .../Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs index 54249e39ba..bd199311ca 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/MeleeWeaponComponent.cs @@ -134,7 +134,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee for (var i = 0; i < increments; i++) { var castAngle = new Angle(baseAngle + increment * i); - var res = _physicsManager.IntersectRay(mapId, new CollisionRay(position, castAngle.ToVec(), 23), _range, ignore); + var res = _physicsManager.IntersectRay(mapId, new CollisionRay(position, castAngle.ToVec(), 23), _range, ignore, ignoreNonHardCollidables: true); if (res.HitEntity != null) { resSet.Add(res.HitEntity); diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs index 3ae6d069cd..3fd4dd5d1e 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Hitscan/HitscanWeaponComponent.cs @@ -90,7 +90,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan var angle = new Angle(clickLocation.Position - userPosition); var ray = new CollisionRay(userPosition, angle.ToVec(), (int)(CollisionGroup.Impassable | CollisionGroup.MobImpassable)); - var rayCastResults = IoCManager.Resolve().IntersectRay(user.Transform.MapID, ray, MaxLength, user); + var rayCastResults = IoCManager.Resolve().IntersectRay(user.Transform.MapID, ray, MaxLength, user, ignoreNonHardCollidables: true); Hit(rayCastResults, energyModifier, user); AfterEffects(user, rayCastResults, angle, energyModifier);