Valheim.CustomRaids/Patches/RandEventSystem_StartRandomEvent_Patch.cs
/// <summary>
/// Stop new raids from initializing when another event is currently active.
/// </summary>
Stop new raids from initializing when another event is currently active.
Stop new raids from initializing when another event is currently active .
[HarmonyPatch(nameof(RandEventSystem.StartRandomEvent))]
        [HarmonyPrefix]
        private static bool DontStartWhileActive()
        {
            if(RandEventSystem.instance.GetActiveEvent() is not null || RandEventSystem.instance.GetCurrentRandomEvent() is not null)
            {
                Log.LogTrace("Skipping starting of new raid due to already active event.");
                return false;
            }
            return true;
        }
[ HarmonyPatch ( nameof ( RandEventSystem . StartRandomEvent ) ) ] [ HarmonyPrefix ] private static bool DontStartWhileActive ( ) { if ( RandEventSystem . instance . GetActiveEvent ( ) is not null || RandEventSystem . instance . GetCurrentRandomEvent ( ) is not null ) { Log . LogTrace ( " " ) ; return false ; } return true ; }
Stop new raids from initializing when another event is currently active.
Stop new raids from initializing when another event is currently active .