Skip to content

Commit

Permalink
ChaosMod: Add .disablebuiltineffects feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed Oct 4, 2023
1 parent 0ab0786 commit 9ca97e8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ChaosMod/Effects/Effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "Effects/EffectTimedType.h"
#include "Effects/EffectsInfo.h"

#include "Util/File.h"

#include <algorithm>
#include <string>

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9ca97e8

Please sign in to comment.