From 9ca97e8ca7f57c3a8132e8b2477645df772fa78a Mon Sep 17 00:00:00 2001 From: pongo1231 Date: Wed, 4 Oct 2023 19:50:02 +0000 Subject: [PATCH] ChaosMod: Add .disablebuiltineffects feature flag --- ChaosMod/Effects/Effect.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ChaosMod/Effects/Effect.h b/ChaosMod/Effects/Effect.h index eb89da347..bf70c9394 100644 --- a/ChaosMod/Effects/Effect.h +++ b/ChaosMod/Effects/Effect.h @@ -6,6 +6,8 @@ #include "Effects/EffectTimedType.h" #include "Effects/EffectsInfo.h" +#include "Util/File.h" + #include #include @@ -140,6 +142,16 @@ class RegisterEffect public: RegisterEffect(void (*onStart)(), void (*onStop)(), void (*onTick)(), EffectInfo &&effectInfo) { + static bool disableEffectRegistration = []() + { + return DoesFileExist("chaosmod\\.disablebuiltineffects"); + }(); + + if (disableEffectRegistration) + { + return; + } + m_RegisteredEffect = { effectInfo.Id, onStart, onStop, onTick }; g_RegisteredEffects.push_back(m_RegisteredEffect);