Skip to content

Commit

Permalink
Fix stun batons using excess charges when thrown (#30136)
Browse files Browse the repository at this point in the history
Fix stun batons

Co-authored-by: plykiya <[email protected]>
  • Loading branch information
Plykiya and plykiya authored Jul 18, 2024
1 parent d7b2e72 commit 961a553
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Content.Shared/Damage/Systems/StaminaSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ private void OnThrowHit(EntityUid uid, StaminaDamageOnCollideComponent component

private void OnCollide(EntityUid uid, StaminaDamageOnCollideComponent component, EntityUid target)
{
// you can't inflict stamina damage on things with no stamina component
// this prevents stun batons from using up charges when throwing it at lockers or lights
if (!HasComp<StaminaComponent>(target))
return;

var ev = new StaminaDamageOnHitAttemptEvent();
RaiseLocalEvent(uid, ref ev);
if (ev.Cancelled)
Expand Down

0 comments on commit 961a553

Please sign in to comment.