From 53ffd97822eb6f404bb4f8fe2368d371e4d564c7 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 30 Aug 2025 06:02:41 -0400 Subject: [PATCH] Revert "- add argument for EventHandler.Find() which allows searching by parent class (default false)" This reverts commit abdacad8d39a34abea46d9ac552853c4991cc979. Revert "- missed one" This reverts commit 03123b96de2b8b2b5684fae4f9b9095094d356db. --- src/events.cpp | 10 ---------- wadsrc/static/zscript/events.zs | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/events.cpp b/src/events.cpp index b87c580c8..80059b5e7 100755 --- a/src/events.cpp +++ b/src/events.cpp @@ -1699,14 +1699,9 @@ DEFINE_ACTION_FUNCTION(DEventHandler, Find) { PARAM_PROLOGUE; PARAM_CLASS(t, DStaticEventHandler); - PARAM_BOOL(subclass); for (DStaticEventHandler* handler = currentVMLevel->localEventManager->FirstEventHandler; handler; handler = handler->next) - { if (handler->GetClass() == t) // check precise class ACTION_RETURN_OBJECT(handler); - else if (subclass && handler->IsKindOf(t)); - ACTION_RETURN_OBJECT(handler); - } ACTION_RETURN_OBJECT(nullptr); } @@ -1715,14 +1710,9 @@ DEFINE_ACTION_FUNCTION(DStaticEventHandler, Find) { PARAM_PROLOGUE; PARAM_CLASS(t, DStaticEventHandler); - PARAM_BOOL(subclass); for (DStaticEventHandler* handler = staticEventManager.FirstEventHandler; handler; handler = handler->next) - { if (handler->GetClass() == t) // check precise class ACTION_RETURN_OBJECT(handler); - else if (subclass && handler->IsKindOf(t)); - ACTION_RETURN_OBJECT(handler); - } ACTION_RETURN_OBJECT(nullptr); } diff --git a/wadsrc/static/zscript/events.zs b/wadsrc/static/zscript/events.zs index 270bae69e..883e8c360 100644 --- a/wadsrc/static/zscript/events.zs +++ b/wadsrc/static/zscript/events.zs @@ -148,7 +148,7 @@ class StaticEventHandler : Object native play version("2.4") { // static event handlers CAN register other static event handlers. // unlike EventHandler.Create that will not create them. - clearscope static native StaticEventHandler Find(Class type, bool subclass = false); // just for convenience. who knows. + clearscope static native StaticEventHandler Find(Class type); // just for convenience. who knows. // these are called when the handler gets registered or unregistered // you can set Order/IsUiProcessor here. @@ -221,7 +221,7 @@ class StaticEventHandler : Object native play version("2.4") class EventHandler : StaticEventHandler native version("2.4") { - clearscope static native StaticEventHandler Find(class type, bool subclass = false); + clearscope static native StaticEventHandler Find(class type); clearscope static native void SendNetworkEvent(String name, int arg1 = 0, int arg2 = 0, int arg3 = 0); version("4.12") clearscope static native vararg bool SendNetworkCommand(Name cmd, ...); version("4.12") clearscope static native bool SendNetworkBuffer(Name cmd, NetworkBuffer buffer);