Fix projectiles (#25636)
This commit is contained in:
@@ -34,7 +34,6 @@ 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);
|
||||
@@ -163,18 +162,6 @@ 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]
|
||||
@@ -201,9 +188,3 @@ public record struct ProjectileReflectAttemptEvent(EntityUid ProjUid, Projectile
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public record struct ProjectileHitEvent(DamageSpecifier Damage, EntityUid Target, EntityUid? Shooter = null);
|
||||
|
||||
/// <summary>
|
||||
/// Raised after a projectile has dealt it's damage.
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public record struct AfterProjectileHitEvent(DamageSpecifier Damage, EntityUid Target, Fixture Fixture);
|
||||
|
||||
Reference in New Issue
Block a user