Inline Deleted
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Content.Server.Projectiles
|
||||
var coordinates = args.OtherFixture.Body.Owner.Transform.Coordinates;
|
||||
var playerFilter = Filter.Pvs(coordinates);
|
||||
|
||||
if (!otherEntity.Deleted && component.SoundHitSpecies != null &&
|
||||
if (!((!IoCManager.Resolve<IEntityManager>().EntityExists(otherEntity.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(otherEntity.Uid).EntityLifeStage) >= EntityLifeStage.Deleted) && component.SoundHitSpecies != null &&
|
||||
otherEntity.HasComponent<SharedBodyComponent>())
|
||||
{
|
||||
SoundSystem.Play(playerFilter, component.SoundHitSpecies.GetSound(), coordinates);
|
||||
@@ -52,7 +52,7 @@ namespace Content.Server.Projectiles
|
||||
SoundSystem.Play(playerFilter, soundHit, coordinates);
|
||||
}
|
||||
|
||||
if (!otherEntity.Deleted)
|
||||
if (!((!IoCManager.Resolve<IEntityManager>().EntityExists(otherEntity.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(otherEntity.Uid).EntityLifeStage) >= EntityLifeStage.Deleted))
|
||||
{
|
||||
var dmg = _damageableSystem.TryChangeDamage(otherEntity.Uid, component.Damage);
|
||||
component.DamagedEntity = true;
|
||||
@@ -63,7 +63,7 @@ namespace Content.Server.Projectiles
|
||||
}
|
||||
|
||||
// Damaging it can delete it
|
||||
if (!otherEntity.Deleted && otherEntity.TryGetComponent(out CameraRecoilComponent? recoilComponent))
|
||||
if (!((!IoCManager.Resolve<IEntityManager>().EntityExists(otherEntity.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(otherEntity.Uid).EntityLifeStage) >= EntityLifeStage.Deleted) && otherEntity.TryGetComponent(out CameraRecoilComponent? recoilComponent))
|
||||
{
|
||||
var direction = args.OurFixture.Body.LinearVelocity.Normalized;
|
||||
recoilComponent.Kick(direction);
|
||||
|
||||
Reference in New Issue
Block a user