From 75e73c1d567b9ec8e6fb4f7f6d252d286494808c Mon Sep 17 00:00:00 2001 From: Borys Stelmakh Date: Tue, 28 Apr 2026 08:14:50 +0400 Subject: [PATCH] Drop IExtensible memory-layout workaround now that getExtension finds dynamic extensions --- src/sampsharp-component/proxies/extension.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/sampsharp-component/proxies/extension.cpp b/src/sampsharp-component/proxies/extension.cpp index b6894163..4aeeeff7 100644 --- a/src/sampsharp-component/proxies/extension.cpp +++ b/src/sampsharp-component/proxies/extension.cpp @@ -46,23 +46,8 @@ extern "C" SDK_EXPORT void * __CDECL ManagedExtensionImpl_getHandle(ManagedExten return handler->getHandle(); } -struct workaround { - void * vptr; - FlatHashMap> miscExtensions; -}; - extern "C" SDK_EXPORT IExtension * __CDECL IExtensible_getExtension_workaround(IExtensible * subject, UID extensionID) { - // workaround for the fact that the SDK doesn't expose the miscExtensions field - // ref: https://github.com/openmultiplayer/open.mp-sdk/issues/44 - workaround * w = (workaround *) subject; - - auto it = w->miscExtensions.find(extensionID); - if (it != w->miscExtensions.end()) - { - return it->second.first; - } - return subject->getExtension(extensionID); }