Checks if user is in combat mode before allowing firing. (#425)

This commit is contained in:
Ephememory
2019-11-10 04:59:26 -05:00
committed by Pieter-Jan Briers
parent 51359cf77b
commit 7032c8a92e

View File

@@ -1,4 +1,5 @@
using System;
using Content.Server.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Weapons.Ranged;
using Robust.Server.Interfaces.Player;
using Robust.Shared.GameObjects;
@@ -66,6 +67,10 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged
return;
}
if(!user.TryGetComponent(out CombatModeComponent combat) || !combat.IsInCombatMode) {
return;
}
if (!UserCanFire(user) || !WeaponCanFire())
{
return;