Fix stun batons using excess charges when thrown (#30136)
Fix stun batons Co-authored-by: plykiya <plykiya@protonmail.com>
This commit is contained in:
parent
d7b2e72882
commit
961a553fa2
1 changed files with 5 additions and 0 deletions
|
|
@ -192,6 +192,11 @@ public sealed partial class StaminaSystem : EntitySystem
|
|||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue