Skip to content

Commit 9fcc9b4

Browse files
committed
Fix h1 fog disable
1 parent fbf3369 commit 9fcc9b4

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

HCMInternal/DisableFog.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,21 @@ class DisableFogImplNopCall : public DisableFog::DisableFogImpl
110110
}
111111
};
112112

113-
// Halo 1 is a module patch + a module nop call patch
113+
// Halo 1 is 2 module patches + a module nop call patch
114114
class DisableFogImplHalo1 : public DisableFog::DisableFogImpl
115115
{
116116
private:
117117
ScopedCallback<ToggleEvent> disableFogToggleCallback;
118118

119119
std::shared_ptr<ModulePatch> disableFogPatchHook;
120120
std::shared_ptr<ModulePatch> disableFogPatchHook2;
121+
std::shared_ptr<ModulePatch> disableFogPatchHook3;
121122

122123
void onDisableFogToggleChanged(bool newValue)
123124
{
124125
disableFogPatchHook->setWantsToBeAttached(newValue);
125126
disableFogPatchHook2->setWantsToBeAttached(newValue);
127+
disableFogPatchHook3->setWantsToBeAttached(newValue);
126128
}
127129

128130

@@ -137,7 +139,11 @@ class DisableFogImplHalo1 : public DisableFog::DisableFogImpl
137139
disableFogPatchHook = ModulePatch::make(gameImpl.toModuleName(), disableFogPatchFunction, *disableFogPatchCode.get());
138140

139141
auto disableFogPatchFunction2 = ptr->getData<std::shared_ptr<MultilevelPointer>>(nameof(disableFogPatchFunction2), gameImpl);
140-
disableFogPatchHook2 = ModulePatch::makeNOPCall(gameImpl.toModuleName(), disableFogPatchFunction2);
142+
auto disableFogPatchCode2 = ptr->getVectorData<byte>(nameof(disableFogPatchCode2), gameImpl);
143+
disableFogPatchHook2 = ModulePatch::make(gameImpl.toModuleName(), disableFogPatchFunction2, *disableFogPatchCode2.get());
144+
145+
auto disableFogPatchFunction3 = ptr->getData<std::shared_ptr<MultilevelPointer>>(nameof(disableFogPatchFunction3), gameImpl);
146+
disableFogPatchHook3 = ModulePatch::makeNOPCall(gameImpl.toModuleName(), disableFogPatchFunction3);
141147
}
142148
};
143149

HCMInternal/InternalPointerData.xml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10640,7 +10640,7 @@
1064010640
<Version Version="1.3385.0.0" Game="Halo1">
1064110641
<Module>halo1.dll</Module>
1064210642
<Offsets>
10643-
<Offset>0xAE09DF</Offset>
10643+
<Offset>0xAE09E1</Offset>
1064410644
</Offsets>
1064510645
</Version>
1064610646

@@ -10682,7 +10682,7 @@
1068210682

1068310683
<VersionedEntry Name="disableFogPatchCode" Type="Vector" Typename="byte">
1068410684
<Version Version="1.3385.0.0" Game="Halo1">
10685-
<Data>0xE9, 0x10, 0x01, 0x00, 0x00, 0x90, 0x90, 0x90, 0x90, 0x90</Data>
10685+
<Data>0xEB, 0x08</Data>
1068610686
</Version>
1068710687

1068810688
<Version Version="1.3385.0.0" Game="Halo2">
@@ -10702,7 +10702,7 @@
1070210702
<Version Version="1.3385.0.0" Game="Halo1">
1070310703
<Module>halo1.dll</Module>
1070410704
<Offsets>
10705-
<Offset>0xBBD39A</Offset>
10705+
<Offset>0xAE0A83</Offset>
1070610706
</Offsets>
1070710707
</Version>
1070810708

@@ -10722,9 +10722,24 @@
1072210722
</VersionedEntry>
1072310723

1072410724

10725+
1072510726
<VersionedEntry Name="disableFogPatchCode2" Type="Vector" Typename="byte">
10727+
<Version Version="1.3385.0.0" Game="Halo1">
10728+
<Data>0xEB, 0x6F</Data>
10729+
</Version>
10730+
1072610731
<Version Version="1.3385.0.0" Game="Halo3ODST">
1072710732
<Data>0xE9, 0xF9, 0x00, 0x00, 0x00</Data>
1072810733
</Version>
1072910734
</VersionedEntry>
10735+
10736+
<VersionedEntry Name="disableFogPatchFunction3" Type="MultilevelPointer::ModuleOffset">
10737+
<Version Version="1.3385.0.0" Game="Halo1">
10738+
<Module>halo1.dll</Module>
10739+
<Offsets>
10740+
<Offset>0xBBD39A</Offset>
10741+
</Offsets>
10742+
</Version>
10743+
10744+
</VersionedEntry>
1073010745
</root>

0 commit comments

Comments
 (0)