From af6e132b37e8b7e89e4c0c7a52e5bb81e4b1b9a8 Mon Sep 17 00:00:00 2001 From: bigbossbro08 Date: Sun, 10 May 2020 19:54:37 +0600 Subject: defined out asserts. --- src/vehicles/Automobile.h | 2 ++ src/vehicles/Boat.h | 2 ++ src/vehicles/Cranes.h | 2 ++ src/vehicles/Heli.h | 3 +++ src/vehicles/Plane.h | 3 +++ src/vehicles/Train.h | 3 +++ src/vehicles/Vehicle.h | 2 ++ 7 files changed, 17 insertions(+) (limited to 'src/vehicles') diff --git a/src/vehicles/Automobile.h b/src/vehicles/Automobile.h index 041302bf..16d1a2ef 100644 --- a/src/vehicles/Automobile.h +++ b/src/vehicles/Automobile.h @@ -197,7 +197,9 @@ public: static void SetAllTaxiLights(bool set); }; +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CAutomobile) == 0x5A8, "CAutomobile: error"); +#endif inline uint8 GetCarDoorFlag(int32 carnode) { switch (carnode) { diff --git a/src/vehicles/Boat.h b/src/vehicles/Boat.h index 70407ab9..014b1e48 100644 --- a/src/vehicles/Boat.h +++ b/src/vehicles/Boat.h @@ -72,7 +72,9 @@ public: }; +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CBoat) == 0x484, "CBoat: error"); +#endif extern float MAX_WAKE_LENGTH; extern float MIN_WAKE_INTERVAL; diff --git a/src/vehicles/Cranes.h b/src/vehicles/Cranes.h index c0502638..4d4c8fb4 100644 --- a/src/vehicles/Cranes.h +++ b/src/vehicles/Cranes.h @@ -72,7 +72,9 @@ public: float GetHeightToDropoffHeight() { return m_fDropoffHeight + (m_bIsCrusher ? 7.0f : 2.0f); } }; +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CCrane) == 128, "CCrane: error"); +#endif class CCranes { diff --git a/src/vehicles/Heli.h b/src/vehicles/Heli.h index 39e4cbcf..d41afb58 100644 --- a/src/vehicles/Heli.h +++ b/src/vehicles/Heli.h @@ -95,4 +95,7 @@ public: static void ActivateHeli(bool activate); }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CHeli) == 0x33C, "CHeli: error"); +#endif diff --git a/src/vehicles/Plane.h b/src/vehicles/Plane.h index 79738858..f0c5902b 100644 --- a/src/vehicles/Plane.h +++ b/src/vehicles/Plane.h @@ -63,7 +63,10 @@ public: static bool HasCesnaBeenDestroyed(void); static bool HasDropOffCesnaBeenShotDown(void); }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CPlane) == 0x29C, "CPlane: error"); +#endif extern float LandingPoint; extern float TakeOffPoint; diff --git a/src/vehicles/Train.h b/src/vehicles/Train.h index bf541250..6fb73169 100644 --- a/src/vehicles/Train.h +++ b/src/vehicles/Train.h @@ -91,4 +91,7 @@ public: float *totalLength, float *totalDuration, CTrainInterpolationLine *interpLines, bool rightRail); static void UpdateTrains(void); }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CTrain) == 0x2E4, "CTrain: error"); +#endif \ No newline at end of file diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 110ff97c..d8891628 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -291,9 +291,11 @@ public: static bool m_bDisableMouseSteering; }; +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CVehicle) == 0x288, "CVehicle: error"); static_assert(offsetof(CVehicle, m_pCurGroundEntity) == 0x1E0, "CVehicle: error"); static_assert(offsetof(CVehicle, m_nAlarmState) == 0x1A0, "CVehicle: error"); static_assert(offsetof(CVehicle, m_nLastWeaponDamage) == 0x228, "CVehicle: error"); +#endif void DestroyVehicleAndDriverAndPassengers(CVehicle* pVehicle); -- cgit v1.2.3 From c798e1bacdaabaf140ff3904948fd7cec46c09bb Mon Sep 17 00:00:00 2001 From: bigbossbro08 Date: Sun, 10 May 2020 21:49:33 +0600 Subject: Fixed typos and made all assert functions optional --- src/vehicles/Automobile.h | 4 +--- src/vehicles/Boat.h | 4 +--- src/vehicles/Cranes.h | 4 +--- src/vehicles/Heli.h | 5 ++--- src/vehicles/Plane.h | 4 +--- src/vehicles/Train.h | 4 +--- src/vehicles/Vehicle.h | 2 +- 7 files changed, 8 insertions(+), 19 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Automobile.h b/src/vehicles/Automobile.h index 16d1a2ef..a3e8ac17 100644 --- a/src/vehicles/Automobile.h +++ b/src/vehicles/Automobile.h @@ -197,9 +197,7 @@ public: static void SetAllTaxiLights(bool set); }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CAutomobile) == 0x5A8, "CAutomobile: error"); -#endif +VALIDATE_SIZE(CAutomobile, 0x5A8); inline uint8 GetCarDoorFlag(int32 carnode) { switch (carnode) { diff --git a/src/vehicles/Boat.h b/src/vehicles/Boat.h index 014b1e48..3cc3513d 100644 --- a/src/vehicles/Boat.h +++ b/src/vehicles/Boat.h @@ -72,9 +72,7 @@ public: }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CBoat) == 0x484, "CBoat: error"); -#endif +VALIDATE_SIZE(CBoat, 0x484); extern float MAX_WAKE_LENGTH; extern float MIN_WAKE_INTERVAL; diff --git a/src/vehicles/Cranes.h b/src/vehicles/Cranes.h index 4d4c8fb4..6d877d82 100644 --- a/src/vehicles/Cranes.h +++ b/src/vehicles/Cranes.h @@ -72,9 +72,7 @@ public: float GetHeightToDropoffHeight() { return m_fDropoffHeight + (m_bIsCrusher ? 7.0f : 2.0f); } }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CCrane) == 128, "CCrane: error"); -#endif +VALIDATE_SIZE(CCrane, 128); class CCranes { diff --git a/src/vehicles/Heli.h b/src/vehicles/Heli.h index d41afb58..cf3f791f 100644 --- a/src/vehicles/Heli.h +++ b/src/vehicles/Heli.h @@ -96,6 +96,5 @@ public: static void ActivateHeli(bool activate); }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CHeli) == 0x33C, "CHeli: error"); -#endif +VALIDATE_SIZE(CHeli, 0x33C); + diff --git a/src/vehicles/Plane.h b/src/vehicles/Plane.h index f0c5902b..7e822d64 100644 --- a/src/vehicles/Plane.h +++ b/src/vehicles/Plane.h @@ -64,9 +64,7 @@ public: static bool HasDropOffCesnaBeenShotDown(void); }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CPlane) == 0x29C, "CPlane: error"); -#endif +VALIDATE_SIZE(CPlane, 0x29C); extern float LandingPoint; extern float TakeOffPoint; diff --git a/src/vehicles/Train.h b/src/vehicles/Train.h index 6fb73169..6aa76fa8 100644 --- a/src/vehicles/Train.h +++ b/src/vehicles/Train.h @@ -92,6 +92,4 @@ public: static void UpdateTrains(void); }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CTrain) == 0x2E4, "CTrain: error"); -#endif \ No newline at end of file +VALIDATE_SIZE(CTrain, 0x2E4); diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index d8891628..76c2b90c 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -291,8 +291,8 @@ public: static bool m_bDisableMouseSteering; }; +VALIDATE_SIZE(CVehicle, 0x288); #ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CVehicle) == 0x288, "CVehicle: error"); static_assert(offsetof(CVehicle, m_pCurGroundEntity) == 0x1E0, "CVehicle: error"); static_assert(offsetof(CVehicle, m_nAlarmState) == 0x1A0, "CVehicle: error"); static_assert(offsetof(CVehicle, m_nLastWeaponDamage) == 0x228, "CVehicle: error"); -- cgit v1.2.3 From b4abb6ddd8c2daee13cc9f83f17286fdf286c798 Mon Sep 17 00:00:00 2001 From: bigbossbro08 Date: Sun, 10 May 2020 22:04:36 +0600 Subject: fixed few more typos --- src/vehicles/Vehicle.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 76c2b90c..f7205c7d 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -292,10 +292,5 @@ public: }; VALIDATE_SIZE(CVehicle, 0x288); -#ifdef CHECK_STRUCT_SIZES -static_assert(offsetof(CVehicle, m_pCurGroundEntity) == 0x1E0, "CVehicle: error"); -static_assert(offsetof(CVehicle, m_nAlarmState) == 0x1A0, "CVehicle: error"); -static_assert(offsetof(CVehicle, m_nLastWeaponDamage) == 0x228, "CVehicle: error"); -#endif void DestroyVehicleAndDriverAndPassengers(CVehicle* pVehicle); -- cgit v1.2.3 From b11715608f5d12d82ecb364b0d2dc76c24d6ab1f Mon Sep 17 00:00:00 2001 From: aap Date: Mon, 11 May 2020 09:18:41 +0200 Subject: few fixes --- src/vehicles/Plane.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/vehicles') diff --git a/src/vehicles/Plane.h b/src/vehicles/Plane.h index 7e822d64..a6f6e1d9 100644 --- a/src/vehicles/Plane.h +++ b/src/vehicles/Plane.h @@ -2,6 +2,13 @@ #include "Vehicle.h" +enum ePlaneNodes +{ + PLANE_WHEEL_FRONT = 2, + PLANE_WHEEL_READ, + NUM_PLANE_NODES +}; + enum ePlanePositions { PLANE_POS_LIGHT_LEFT, -- cgit v1.2.3