From 938b23ee4940e7b1081f8d58ee9c651b0fafcd35 Mon Sep 17 00:00:00 2001
From: Alex S <43192081+MemeProof@users.noreply.github.com>
Date: Fri, 17 Jul 2020 04:45:35 -0400
Subject: [PATCH] Projectiles Now check for Hard (#1397)
---
.../Components/Projectiles/ProjectileComponent.cs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs
index d1d0e45fd3..0cbbd5ab55 100644
--- a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs
+++ b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs
@@ -63,6 +63,15 @@ namespace Content.Server.GameObjects.Components.Projectiles
///
void ICollideBehavior.CollideWith(IEntity entity)
{
+ // This is so entities that shouldn't get a collision are ignored.
+ if (entity.TryGetComponent(out ICollidableComponent collidable) && collidable.Hard == false)
+ {
+ _deleteOnCollide = false;
+ return;
+ }
+ else
+ _deleteOnCollide = true;
+
if (_soundHitSpecies != null && entity.HasComponent())
{
EntitySystem.Get().PlayAtCoords(_soundHitSpecies, entity.Transform.GridPosition);