Skip to content

Commit bc797d3

Browse files
authored
Fix LOD lights appearing at the wrong time (#119)
* Fix LOD lights appearing at the wrong time
1 parent c9e5a7b commit bc797d3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

source/dllmain.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,18 @@ void Init()
13501350
}; injector::MakeInline<SetVertexShaderConstantFHook>(pattern.count(2).get(1).get<void*>(0), pattern.count(2).get(1).get<void*>(6));
13511351
}
13521352
}
1353+
1354+
// Make LOD lights appear at the appropriate time like on the console version (consoles: 7 PM, pc: 10 PM)
1355+
{
1356+
auto pattern = hook::pattern("8D 42 13");
1357+
if (!pattern.empty()) injector::WriteMemory<uint8_t>(pattern.get_first(2), 0x10, true);
1358+
pattern = hook::pattern("8D 42 14 3B C8");
1359+
if (!pattern.empty()) injector::WriteMemory<uint8_t>(pattern.get_first(2), 0x10, true);
1360+
if (!pattern.empty()) injector::WriteMemory<uint8_t>(pattern.get_first(8), 0x07, true);
1361+
// Removing episode id check that resulted in flickering LOD lights at certain camera angles in TBOGT
1362+
pattern = hook::pattern("83 3D ? ? ? ? ? 0F 85 ? ? ? ? F3 0F 10 05 ? ? ? ? F3 0F 10 8C 24");
1363+
if (!pattern.empty()) injector::MakeNOP(pattern.get_first(0), 150, true);
1364+
}
13531365
}
13541366

13551367
CEXP void InitializeASI()

0 commit comments

Comments
 (0)