@@ -1031,20 +1031,19 @@ bool Client::Init() {
10311031 MatrixBuildRotationAboutAxis = (decltype (MatrixBuildRotationAboutAxis))Memory::Scan (client->Name (), Offsets::MatrixBuildRotationAboutAxis);
10321032 MatrixBuildRotationAboutAxisHook.SetFunc (MatrixBuildRotationAboutAxis, false ); // only during ApplyMouse
10331033
1034- auto drawPortalSpBranch = Memory::Scan (client->Name (), Offsets::DrawPortalSpBranch);
1035- auto drawPortalGhostSpBranch = Memory::Scan (client->Name (), Offsets::DrawPortalGhostSpBranch);
1036-
10371034 Client::DrawPortal = (decltype (Client::DrawPortal))Memory::Scan (client->Name (), Offsets::DrawPortal);
10381035 g_DrawPortalGhost = (decltype (g_DrawPortalGhost))Memory::Scan (client->Name (), Offsets::DrawPortalGhost);
1036+ if (Client::DrawPortal && g_DrawPortalGhost) {
1037+ auto drawPortalSpBranch = Memory::Scan (client->Name (), Offsets::DrawPortalSpBranch);
1038+ auto drawPortalGhostSpBranch = Memory::Scan (client->Name (), Offsets::DrawPortalGhostSpBranch);
10391039
1040- g_DrawPortalHook.SetFunc (Client::DrawPortal);
1041- g_DrawPortalGhostHook.SetFunc (g_DrawPortalGhost);
1040+ g_DrawPortalHook.SetFunc (Client::DrawPortal);
1041+ g_DrawPortalGhostHook.SetFunc (g_DrawPortalGhost);
10421042
1043- g_drawPortalPatch = new Memory::Patch ();
1044- g_drawPortalGhostPatch = new Memory::Patch ();
1043+ g_drawPortalPatch = new Memory::Patch ();
1044+ g_drawPortalGhostPatch = new Memory::Patch ();
10451045
1046- unsigned char drawPortalGhostByte = 0x80 ;
1047- if (drawPortalSpBranch && drawPortalGhostSpBranch) {
1046+ unsigned char drawPortalGhostByte = 0x80 ;
10481047#ifndef _WIN32
10491048 unsigned char drawPortalBytes[5 ];
10501049
0 commit comments