Fix CanDisarm (#11843)

This commit is contained in:
metalgearsloth
2022-10-15 15:14:07 +11:00
committed by GitHub
parent 635057fb7a
commit a93d6eb5b6
5 changed files with 16 additions and 10 deletions

View File

@@ -202,8 +202,11 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
if (!base.DoDisarm(user, ev, component))
return false;
if (!HasComp<CombatModeComponent>(user))
if (!TryComp<CombatModeComponent>(user, out var combatMode) ||
combatMode.CanDisarm != true)
{
return false;
}
// If target doesn't have hands then we can't disarm so will let the player know it's pointless.
if (!HasComp<HandsComponent>(ev.Target!.Value))