File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -538,9 +538,9 @@ void EffectDispatcher::DispatchRandomEffect(DispatchEffectFlags dispatchEffectFl
538538 return ;
539539
540540 std::unordered_map<EffectIdentifier, EffectData, EffectsIdentifierHasher> choosableEffects;
541- for (const auto &[effectId, effectData] : g_EnabledEffects )
542- if (!effectData. IsMeta () && !effectData. IsUtility () && !effectData. IsHidden ())
543- choosableEffects.emplace (effectId, effectData);
541+ for (const auto &effectData : GetFilteredEnabledEffects () )
542+ if (!effectData-> IsMeta () && !effectData-> IsUtility () && !effectData-> IsHidden ())
543+ choosableEffects.emplace (effectData-> Id , * effectData);
544544
545545 float totalWeight = 0 .f ;
546546 for (const auto &[effectId, effectData] : choosableEffects)
Original file line number Diff line number Diff line change 77
88EffectShortcuts::EffectShortcuts () : Component()
99{
10- for (const auto &[effectId, effectData] : g_EnabledEffects )
11- if (effectData. ShortcutKeycode > 0 && !effectData. IsHidden ())
12- m_AvailableShortcuts[effectData. ShortcutKeycode ].push_back (effectId );
10+ for (const auto &effectData : GetFilteredEnabledEffects () )
11+ if (effectData-> ShortcutKeycode > 0 && !effectData-> IsHidden ())
12+ m_AvailableShortcuts[effectData-> ShortcutKeycode ].push_back (effectData-> Id );
1313}
1414
1515void EffectShortcuts::OnRun ()
Original file line number Diff line number Diff line change @@ -304,8 +304,10 @@ void Voting::OnRun()
304304
305305bool Voting::Init ()
306306{
307- if (std::count_if (g_EnabledEffects.begin (), g_EnabledEffects.end (),
308- [](const auto &pair) { return !pair.second .IsExcludedFromVoting (); })
307+ const auto enabledEffects = GetFilteredEnabledEffects ();
308+
309+ if (std::count_if (enabledEffects.begin (), enabledEffects.end (),
310+ [](const auto &effectData) { return !effectData->IsExcludedFromVoting (); })
309311 < 3 )
310312 {
311313 ErrorOutWithMsg (" You need at least 3 enabled effects (which are not excluded from voting) to enable voting."
You can’t perform that action at this time.
0 commit comments