MCPcopy Create free account
hub / github.com/Norbyte/bg3se / Initialize

Method Initialize

BG3Extender/Extender/Server/ScriptExtenderServer.cpp:42–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void ScriptExtender::Initialize()
43{
44 auto& lib = GetStaticSymbols();
45
46 if (!gExtender->GetLibraryManager().CriticalInitializationFailed()) {
47 DetourTransactionBegin();
48 DetourUpdateThread(GetCurrentThread());
49
50 if (lib.esv__GameStateThreaded__GameStateWorker__DoWork != nullptr) {
51 gameStateWorkerStart_.Wrap(lib.esv__GameStateThreaded__GameStateWorker__DoWork);
52 }
53
54 if (lib.esv__GameStateMachine__Update != nullptr) {
55 gameStateMachineUpdate_.Wrap(lib.esv__GameStateMachine__Update);
56 }
57
58 DetourTransactionCommit();
59
60 gameStateWorkerStart_.SetWrapper(&ScriptExtender::GameStateWorkerWrapper, this);
61 gameStateMachineUpdate_.SetPrePostHook(&ScriptExtender::PreUpdate, &ScriptExtender::PostUpdate, this);
62
63 gExtender->GetEngineHooks().esv__OsirisVariableHelper__SavegameVisit.SetPreHook(&ScriptExtender::OnSavegameVisit, this);
64 }
65}
66
67void ScriptExtender::Shutdown()
68{

Callers 1

PostStartupMethod · 0.45

Calls 5

SetWrapperMethod · 0.80
SetPrePostHookMethod · 0.80
SetPreHookMethod · 0.80
WrapMethod · 0.45

Tested by

no test coverage detected