fix reflected projectiles dealing stamina damage (#17648)

This commit is contained in:
Slava0135
2023-08-06 16:44:41 +03:00
committed by GitHub
parent c6f80b2efb
commit b49f0df05e
5 changed files with 46 additions and 54 deletions

View File

@@ -38,21 +38,21 @@ public abstract class SharedReflectSystem : EntitySystem
SubscribeLocalEvent<HandsComponent, ProjectileReflectAttemptEvent>(OnHandReflectProjectile);
SubscribeLocalEvent<HandsComponent, HitScanReflectAttemptEvent>(OnHandsReflectHitscan);
SubscribeLocalEvent<ReflectComponent, ProjectileCollideEvent>(OnReflectCollide);
SubscribeLocalEvent<ReflectComponent, ProjectileReflectAttemptEvent>(OnReflectCollide);
SubscribeLocalEvent<ReflectComponent, HitScanReflectAttemptEvent>(OnReflectHitscan);
SubscribeLocalEvent<ReflectComponent, GotEquippedEvent>(OnReflectEquipped);
SubscribeLocalEvent<ReflectComponent, GotUnequippedEvent>(OnReflectUnequipped);
}
private void OnReflectCollide(EntityUid uid, ReflectComponent component, ref ProjectileCollideEvent args)
private void OnReflectCollide(EntityUid uid, ReflectComponent component, ref ProjectileReflectAttemptEvent args)
{
if (args.Cancelled)
{
return;
}
if (TryReflectProjectile(uid, args.OtherEntity, reflect: component))
if (TryReflectProjectile(uid, args.ProjUid, reflect: component))
args.Cancelled = true;
}