From cae1063ad99a29aed3a0c162bad1d2842376c608 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 11 May 2022 19:15:22 -0400 Subject: move filtering only used in one place out of managed event --- src/SMAPI/Framework/Events/ManagedEvent.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/SMAPI/Framework/Events/ManagedEvent.cs') diff --git a/src/SMAPI/Framework/Events/ManagedEvent.cs b/src/SMAPI/Framework/Events/ManagedEvent.cs index abeea098..a34106ce 100644 --- a/src/SMAPI/Framework/Events/ManagedEvent.cs +++ b/src/SMAPI/Framework/Events/ManagedEvent.cs @@ -118,8 +118,7 @@ namespace StardewModdingAPI.Framework.Events /// Raise the event and notify all handlers. /// Invoke an event handler. This receives the mod which registered the handler, and should invoke the callback with the event arguments to pass it. - /// A lambda which returns true if the event should be raised for the given mod. - public void Raise(Action> invoke, Func? match = null) + public void Raise(Action> invoke) { // skip if no handlers if (this.Handlers.Count == 0) @@ -128,9 +127,6 @@ namespace StardewModdingAPI.Framework.Events // raise event foreach (ManagedEventHandler handler in this.GetHandlers()) { - if (match != null && !match(handler.SourceMod)) - continue; - try { invoke(handler.SourceMod, args => handler.Handler(null, args)); -- cgit