Checks if user is in combat mode before allowing firing. (#425)
This commit is contained in:
committed by
Pieter-Jan Briers
parent
51359cf77b
commit
7032c8a92e
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user