From fe55483ceaaae7b14fad984a495b07272679bd5d Mon Sep 17 00:00:00 2001 From: Ryan <80224521+Rxann@users.noreply.github.com> Date: Wed, 7 Aug 2024 23:01:07 -0400 Subject: [PATCH] Class Optimizations (#34) --- .../projectile/CProjectileCreationData.hpp | 40 +++++++------------ network/sync/vehicle/CVehicleGadgetData.hpp | 8 ++-- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/network/sync/projectile/CProjectileCreationData.hpp b/network/sync/projectile/CProjectileCreationData.hpp index 00ff27c..f03b282 100644 --- a/network/sync/projectile/CProjectileCreationData.hpp +++ b/network/sync/projectile/CProjectileCreationData.hpp @@ -1,30 +1,18 @@ #pragma once -#include #include "rage/vector.hpp" +#include -struct CProjectileCreationData -{ - uint16_t unk_0000; - uint16_t m_OwnerObjectId; - uint32_t m_AmmoHash; - uint32_t m_WeaponHash; - uint32_t unk_000C; - rage::vector3 m_Vector; - uint32_t unk_0020; - uint16_t m_ObjectId2; - char pad_0026[2]; - bool unk_0028; - char pad_0029[3]; - uint32_t unk_002C; - bool pad_0030; - bool unk_0031; - char pad_0032[2]; - float unk_0034; - bool unk_0038; - bool unk_0039; - bool unk_003A; - bool unk_003B; - char pad_003C[4]; - rage::matrix34 m_Matrix; + +struct CProjectileCreationData { + char m_Pad1[2]; + uint16_t m_OwnerObjectId; + uint32_t m_AmmoHash; + uint32_t m_WeaponHash; + char m_Pad2[4]; + rage::vector3 m_Velocity; + char m_Pad3[4]; + uint16_t m_ObjectId2; + char m_Pad4[26]; + rage::matrix34 m_InitialPosition; }; -static_assert(sizeof(CProjectileCreationData) == 0x80); \ No newline at end of file +static_assert(sizeof(CProjectileCreationData) == 0x80); diff --git a/network/sync/vehicle/CVehicleGadgetData.hpp b/network/sync/vehicle/CVehicleGadgetData.hpp index d018279..2fb4be9 100644 --- a/network/sync/vehicle/CVehicleGadgetData.hpp +++ b/network/sync/vehicle/CVehicleGadgetData.hpp @@ -1,8 +1,7 @@ #pragma once #include -class CGadgetData -{ +class CGadgetData { public: uint32_t m_Type; uint8_t m_Data[0xF3]; @@ -10,8 +9,7 @@ public: static_assert(sizeof(CGadgetData) == 0xF8); // TODO: Fix this -class CVehicleGadgetDataNode -{ +class CVehicleGadgetData { public: bool m_HasPosition; char pad_0001[15]; @@ -20,4 +18,4 @@ public: char pad_0002[12]; CGadgetData m_Gadgets[2]; }; -static_assert(sizeof(CVehicleGadgetDataNode) == 0x220); \ No newline at end of file +static_assert(sizeof(CVehicleGadgetData) == 0x220); \ No newline at end of file