diff options
Diffstat (limited to 'src/vehicles/Plane.cpp')
-rw-r--r-- | src/vehicles/Plane.cpp | 93 |
1 files changed, 36 insertions, 57 deletions
diff --git a/src/vehicles/Plane.cpp b/src/vehicles/Plane.cpp index c2b9e493..273ac54a 100644 --- a/src/vehicles/Plane.cpp +++ b/src/vehicles/Plane.cpp @@ -1,6 +1,6 @@ #include "common.h" #include "main.h" -#include "patcher.h" + #include "General.h" #include "ModelIndices.h" #include "FileMgr.h" @@ -16,35 +16,35 @@ #include "HandlingMgr.h" #include "Plane.h" -CPlaneNode *&pPathNodes = *(CPlaneNode**)0x8F1B68; -CPlaneNode *&pPath2Nodes = *(CPlaneNode**)0x885B8C; -CPlaneNode *&pPath3Nodes = *(CPlaneNode**)0x885B78; -CPlaneNode *&pPath4Nodes = *(CPlaneNode**)0x885AD8; -int32 &NumPathNodes = *(int32*)0x8F2BE4; -int32 &NumPath2Nodes = *(int32*)0x941498; -int32 &NumPath3Nodes = *(int32*)0x9414D8; -int32 &NumPath4Nodes = *(int32*)0x9412C8; -float &TotalLengthOfFlightPath = *(float*)0x8F2C6C; -float &TotalLengthOfFlightPath2 = *(float*)0x64CFBC; -float &TotalLengthOfFlightPath3 = *(float*)0x64CFD0; -float &TotalLengthOfFlightPath4 = *(float*)0x64CFDC; -float &TotalDurationOfFlightPath = *(float*)0x64CFB8; -float &TotalDurationOfFlightPath2 = *(float*)0x64CFC0; -float &TotalDurationOfFlightPath3 = *(float*)0x64CFD4; -float &TotalDurationOfFlightPath4 = *(float*)0x64CFE0; -float &LandingPoint = *(float*)0x8F2C7C; -float &TakeOffPoint = *(float*)0x8E28A4; -CPlaneInterpolationLine *aPlaneLineBits = (CPlaneInterpolationLine*)0x734168; //[6] - -float *PlanePathPosition = (float*)0x8F5FC8; //[3] -float *OldPlanePathPosition = (float*)0x8F5FBC; //[3] -float *PlanePathSpeed = (float*)0x941538; //[3] -float *PlanePath2Position = (float*)0x64CFC4; //[3] -float &PlanePath3Position = *(float*)0x64CFD8; -float &PlanePath4Position = *(float*)0x64CFE4; -float *PlanePath2Speed = (float*)0x8F1A54; //[3] -float &PlanePath3Speed = *(float*)0x8F1A94; -float &PlanePath4Speed = *(float*)0x8F1AFC; +CPlaneNode *pPathNodes; +CPlaneNode *pPath2Nodes; +CPlaneNode *pPath3Nodes; +CPlaneNode *pPath4Nodes; +int32 NumPathNodes; +int32 NumPath2Nodes; +int32 NumPath3Nodes; +int32 NumPath4Nodes; +float TotalLengthOfFlightPath; +float TotalLengthOfFlightPath2; +float TotalLengthOfFlightPath3; +float TotalLengthOfFlightPath4; +float TotalDurationOfFlightPath; +float TotalDurationOfFlightPath2; +float TotalDurationOfFlightPath3; +float TotalDurationOfFlightPath4; +float LandingPoint; +float TakeOffPoint; +CPlaneInterpolationLine aPlaneLineBits[6]; + +float PlanePathPosition[3]; +float OldPlanePathPosition[3]; +float PlanePathSpeed[3]; +float PlanePath2Position[3]; +float PlanePath3Position; +float PlanePath4Position; +float PlanePath2Speed[3]; +float PlanePath3Speed; +float PlanePath4Speed; enum @@ -55,12 +55,12 @@ enum CESNA_STATUS_LANDED, }; -int32 &CesnaMissionStatus = *(int32*)0x64CFE8; -int32 &CesnaMissionStartTime = *(int32*)0x64CFEC; -CPlane *&pDrugRunCesna = *(CPlane**)0x8F5F80; -int32 &DropOffCesnaMissionStatus = *(int32*)0x64CFF0; -int32 &DropOffCesnaMissionStartTime = *(int32*)0x64CFF4; -CPlane *&pDropOffCesna = *(CPlane**)0x8E2A38; +int32 CesnaMissionStatus; +int32 CesnaMissionStartTime; +CPlane *pDrugRunCesna; +int32 DropOffCesnaMissionStatus; +int32 DropOffCesnaMissionStartTime; +CPlane *pDropOffCesna; CPlane::CPlane(int32 id, uint8 CreatedBy) @@ -965,24 +965,3 @@ const CVector CPlane::FindDropOffCesnaCoordinates(void) { return pDropOffCesna-> bool CPlane::HasCesnaLanded(void) { return CesnaMissionStatus == CESNA_STATUS_LANDED; } bool CPlane::HasCesnaBeenDestroyed(void) { return CesnaMissionStatus == CESNA_STATUS_DESTROYED; } bool CPlane::HasDropOffCesnaBeenShotDown(void) { return DropOffCesnaMissionStatus == CESNA_STATUS_DESTROYED; } - -#include <new> - -class CPlane_ : public CPlane -{ -public: - void ctor(int32 id, uint8 CreatedBy) { ::new (this) CPlane(id, CreatedBy); } - void dtor(void) { CPlane::~CPlane(); } -}; - -STARTPATCHES - InjectHook(0x54B170, &CPlane_::ctor, PATCH_JUMP); - InjectHook(0x54B270, &CPlane_::dtor, PATCH_JUMP); - InjectHook(0x54B820, CPlane::InitPlanes, PATCH_JUMP); - InjectHook(0x54BCD0, CPlane::Shutdown, PATCH_JUMP); - InjectHook(0x54BD50, CPlane::LoadPath, PATCH_JUMP); - InjectHook(0x54BEC0, CPlane::UpdatePlanes, PATCH_JUMP); - InjectHook(0x54DE90, CPlane::TestRocketCollision, PATCH_JUMP); - InjectHook(0x54E000, CPlane::CreateIncomingCesna, PATCH_JUMP); - InjectHook(0x54E160, CPlane::CreateDropOffCesna, PATCH_JUMP); -ENDPATCHES |