Skip to content

Commit

Permalink
feex more.
Browse files Browse the repository at this point in the history
  • Loading branch information
IProduceWidgets committed Aug 15, 2024
1 parent 89018ba commit cfc15aa
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions Content.Server/Damage/Systems/DamageOnLandSystem.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using Content.Server.Damage.Components;
using Content.Shared.CombatMode.Pacification;
using Content.Shared.Damage;
using Content.Shared.Throwing;

namespace Content.Server.Damage.Systems
{
/// <summary>
/// Damages the thrown item when it lands.
/// </summary>
public sealed class DamageOnLandSystem : EntitySystem
{
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
Expand All @@ -13,19 +15,6 @@ public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DamageOnLandComponent, LandEvent>(DamageOnLand);
SubscribeLocalEvent<DamageOnLandComponent, AttemptPacifiedThrowEvent>(OnAttemptPacifiedThrow);
}

/// <summary>
/// Prevent Pacified entities from throwing damaging items.
/// </summary>
private void OnAttemptPacifiedThrow(Entity<DamageOnLandComponent> ent, ref AttemptPacifiedThrowEvent args)
{
// Allow healing projectiles, forbid any that do damage:
if (ent.Comp.Damage.AnyPositive())
{
args.Cancel("pacified-cannot-throw");
}
}

private void DamageOnLand(EntityUid uid, DamageOnLandComponent component, ref LandEvent args)
Expand Down

0 comments on commit cfc15aa

Please sign in to comment.