Skip to content

Commit

Permalink
Use vanilla swizzler to swizzle LightSource
Browse files Browse the repository at this point in the history
  • Loading branch information
chaserli committed Mar 10, 2024
1 parent c697415 commit c1fb1d9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Ext/Building/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ void BuildingExt::ExtData::Serialize(T& Stm)
.Process(this->GrindingWeapon_LastFiredFrame)
.Process(this->CurrentAirFactory)
.Process(this->AccumulatedIncome)
.Process(this->OwnerObject()->LightSource)
.Process(this->CurrentLaserWeaponIndex)
;
}
Expand Down Expand Up @@ -414,6 +413,15 @@ DEFINE_HOOK(0x453E20, BuildingClass_SaveLoad_Prefix, 0x5)
return 0;
}

DEFINE_HOOK(0x454174, BuildingClass_Load, 0xA)
{
GET(BuildingClass*, pThis, EDI);

SwizzleManagerClass::Instance->Swizzle((void**)&pThis->LightSource);

return 0x45417E;
}

DEFINE_HOOK(0x45417E, BuildingClass_Load_Suffix, 0x5)
{
BuildingExt::ExtMap.LoadStatic();
Expand Down

0 comments on commit c1fb1d9

Please sign in to comment.