Skip to content

Commit a18fabe

Browse files
committed
cloning: don't update event manager when pool isn't existent
1 parent a60a53b commit a18fabe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

code/components/gta-net-five/src/CloneExperiments.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -1497,8 +1497,15 @@ static void EventMgr_AddEvent(void* eventMgr, rage::netGameEvent* ev)
14971497
++eventHeader;
14981498
}
14991499

1500+
static atPoolBase** g_netGameEventPool;
1501+
15001502
static void EventManager_Update()
15011503
{
1504+
if (!*g_netGameEventPool)
1505+
{
1506+
return;
1507+
}
1508+
15021509
for (auto& eventPair : g_events)
15031510
{
15041511
auto [ev, time] = eventPair.second;
@@ -1719,6 +1726,11 @@ static HookFunction hookFunctionEv([]()
17191726
MH_CreateHook(hook::get_pattern("85 DB 74 78 44 8B F3 48", -0x30), GetFireApplicability, (void**)&g_origGetFireApplicability);
17201727

17211728
MH_EnableHook(MH_ALL_HOOKS);
1729+
1730+
{
1731+
auto location = hook::get_pattern("44 8B 40 20 8B 40 10 41 C1 E0 02 41 C1 F8 02 41 2B C0 0F 85", -7);
1732+
g_netGameEventPool = hook::get_address<decltype(g_netGameEventPool)>(location);
1733+
}
17221734
});
17231735

17241736
#include <nutsnbolts.h>

0 commit comments

Comments
 (0)