From a075a0844ac05f0018b2a5b3c93d7470a314d55e Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 6 Sep 2017 17:47:26 +0200 Subject: [PATCH] release 2.4 --- src/debugmenu_public.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/debugmenu_public.h b/src/debugmenu_public.h index 42fd986..5bc72bd 100644 --- a/src/debugmenu_public.h +++ b/src/debugmenu_public.h @@ -22,6 +22,7 @@ typedef void (*DebugMenuEntrySetAddress_TYPE)(DebugMenuEntry *e, void *addr); struct DebugMenuAPI { + bool isLoaded; DebugMenuAddInt8_TYPE addint8; DebugMenuAddInt16_TYPE addint16; DebugMenuAddInt32_TYPE addint32; @@ -70,6 +71,8 @@ inline void DebugMenuEntrySetAddress(DebugMenuEntry *e, void *addr) inline bool DebugMenuLoad(void) { + if(gDebugMenuAPI.isLoaded) + return true; HMODULE mod = LoadLibrary("debugmenu.dll"); if(mod == 0){ char modulePath[MAX_PATH]; @@ -97,6 +100,7 @@ inline bool DebugMenuLoad(void) gDebugMenuAPI.setwrap = (DebugMenuEntrySetWrap_TYPE)GetProcAddress(mod, "DebugMenuEntrySetWrap"); gDebugMenuAPI.setstrings = (DebugMenuEntrySetStrings_TYPE)GetProcAddress(mod, "DebugMenuEntrySetStrings"); gDebugMenuAPI.setaddress = (DebugMenuEntrySetAddress_TYPE)GetProcAddress(mod, "DebugMenuEntrySetAddress"); + gDebugMenuAPI.isLoaded = true; return true; }