basemodulecomponent & sharedgunsystem

This commit is contained in:
CaYpeN1
2024-03-22 19:36:18 +05:00
parent 5f610860f5
commit 3dbd027b52
9 changed files with 89 additions and 65 deletions

View File

@@ -1,5 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using Content.Shared._White.WeaponModules;
using Content.Shared.ActionBlocker;
using Content.Shared.Actions;
using Content.Shared.Administration.Logs;
@@ -476,6 +477,9 @@ public abstract partial class SharedGunSystem : EntitySystem
protected void MuzzleFlash(EntityUid gun, AmmoComponent component, EntityUid? user = null)
{
bool cancelled = TryComp<WeaponModulesComponent>(gun, out var weaponModulesComponent) && weaponModulesComponent.UseEffect;
if(cancelled) return;
var attemptEv = new GunMuzzleFlashAttemptEvent();
RaiseLocalEvent(gun, ref attemptEv);
if (attemptEv.Cancelled)