Revert "Cleanup ExecutionSystem (#24382)" (#25555)

* Revert "Cleanup ExecutionSystem (#24382)"

This reverts commit bcbe2ec1af.

* Revert "Executions (#24150)"

This reverts commit 2e83f5a0ec.

# Conflicts:
#	Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs
This commit is contained in:
metalgearsloth
2024-02-25 22:36:17 +11:00
committed by GitHub
parent bcbe2ec1af
commit bb0776c496
27 changed files with 71 additions and 595 deletions

View File

@@ -34,6 +34,7 @@ public abstract partial class SharedProjectileSystem : EntitySystem
base.Initialize();
SubscribeLocalEvent<ProjectileComponent, PreventCollideEvent>(PreventCollision);
SubscribeLocalEvent<ProjectileComponent, AfterProjectileHitEvent>(AfterProjectileHit);
SubscribeLocalEvent<EmbeddableProjectileComponent, ProjectileHitEvent>(OnEmbedProjectileHit);
SubscribeLocalEvent<EmbeddableProjectileComponent, ThrowDoHitEvent>(OnEmbedThrowDoHit);
SubscribeLocalEvent<EmbeddableProjectileComponent, ActivateInWorldEvent>(OnEmbedActivate);
@@ -162,6 +163,18 @@ public abstract partial class SharedProjectileSystem : EntitySystem
{
args.Cancel("pacified-cannot-throw-embed");
}
/// <summary>
/// Checks if the projectile is allowed to penetrate the target it hit.
/// </summary>
private void AfterProjectileHit(EntityUid uid, ProjectileComponent component, ref AfterProjectileHitEvent args)
{
//Overrides the original DeleteOnCollide if the projectile passes all penetration checks.
//This is to prevent having to set DeleteOnCollide to false on every prototype
//you want to give the ability to penetrate entities.
if(component.DeleteOnCollide)
component.DeleteOnCollide = false;
}
}
[Serializable, NetSerializable]
@@ -193,4 +206,4 @@ public record struct ProjectileHitEvent(DamageSpecifier Damage, EntityUid Target
/// Raised after a projectile has dealt it's damage.
/// </summary>
[ByRefEvent]
public record struct AfterProjectileHitEvent(DamageSpecifier Damage, EntityUid Target);
public record struct AfterProjectileHitEvent(DamageSpecifier Damage, EntityUid Target, Fixture Fixture);