Skip to content

Commit

Permalink
test part of secsome old code
Browse files Browse the repository at this point in the history
  • Loading branch information
chaserli committed Dec 18, 2024
1 parent a650e6b commit fc1293f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Misc/Hooks.BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,30 @@ DEFINE_JUMP(LJMP, 0x65B3F7, 0x65B416);//RadSite, no effect
DEFINE_JUMP(LJMP, 0x67E3BD, 0x67E3D3); // Save
DEFINE_JUMP(LJMP, 0x67F72E, 0x67F744); // Load

DEFINE_HOOK(0x6851AC, ScenarioClass_PostLoad_Lighting, 0x5)
{
// Original code : secsome
MapClass::Instance->CellIteratorReset();
for (auto pCell = MapClass::Instance->CellIteratorNext(); pCell; pCell = MapClass::Instance->CellIteratorNext())
pCell->InitLightConvert();

auto tint = ScenarioClass::Instance->NormalLighting.Tint;
if (tint != TintStruct{-1, -1, -1})
{
for (auto pLightConvert : *LightConvertClass::Array)
pLightConvert->UpdateColors(tint.Red * 10, tint.Green * 10, tint.Blue * 10, false);
for (auto pScheme : *ColorScheme::Array)
pScheme->LightConvert->UpdateColors(tint.Red * 10, tint.Green * 10, tint.Blue * 10, false);
ScenarioClass::UpdateHashPalLighting(tint.Red * 10, tint.Green * 10, tint.Blue * 10, false);
}

// Vanilla instructions
ScenarioClass::UpdateCellLighting();
HouseClass::CurrentPlayer->RecheckRadar = true;

return 0x6851B1;
}

#pragma endregion save_load

// An attempt to fix an issue where the ATC->CurrentVector does not contain every air Techno in given range that increases in frequency as the range goes up.
Expand Down

0 comments on commit fc1293f

Please sign in to comment.