Skip to content

Commit

Permalink
Fix SeparateAircraft=no crashing game
Browse files Browse the repository at this point in the history
  • Loading branch information
Starkku committed Jul 26, 2024
1 parent 49a645f commit de241d3
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/Ext/Aircraft/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,27 @@ DEFINE_HOOK(0x4CF31C, FlyLocomotionClass_FlightUpdate_LandingDir, 0x9)
return SkipGameCode;
}

DEFINE_HOOK(0x446F6C, BuildingClass_GrandOpening_PoseDir, 0x9)
namespace SeparateAircraftTemp
{
BuildingClass* pBuilding = nullptr;
}

DEFINE_HOOK(0x446F57, BuildingClass_GrandOpening_PoseDir_SetContext, 0x6)
{
GET(BuildingClass*, pThis, EBP);
GET(AircraftClass*, pAircraft, ESI);

R->EAX(AircraftExt::GetLandingDir(pAircraft, pThis));
SeparateAircraftTemp::pBuilding = pThis;

return 0;
}

DirType _fastcall AircraftClass_PoseDir_Wrapper(AircraftClass* pThis)
{
return AircraftExt::GetLandingDir(pThis, SeparateAircraftTemp::pBuilding);
}

DEFINE_JUMP(CALL, 0x446F67, GET_OFFSET(AircraftClass_PoseDir_Wrapper)); // BuildingClass_GrandOpening

DEFINE_HOOK(0x443FC7, BuildingClass_ExitObject_PoseDir1, 0x8)
{
GET(BuildingClass*, pThis, ESI);
Expand Down

0 comments on commit de241d3

Please sign in to comment.