using Titled_Gui.Data.Game;

namespace Titled_Gui.Modules.Visual
{
    public class NoFlash : Classes.ThreadService, IModule
    {
        public static bool NoFlashEnable = false;
        public static void RemoveFlash()
        {
            if (!NoFlashEnable || GameState.memory == null)
                return;

            float flashBangDuration = GameState.memory.ReadFloat(GameState.client, Offsets.m_flFlashBangTime);

            if (flashBangDuration > 0)
                GameState.memory.WriteInt(GameState.LocalPlayerPawn, Offsets.m_flFlashBangTime, 0);

        }
        protected override void FrameAction()
        {
            RemoveFlash();
            Thread.Sleep(25);
        }
    }
}
