Skip to content

Commit

Permalink
Fix netObject. (#187)
Browse files Browse the repository at this point in the history
* Fix netObject.

* Fixed m_object_id being incorrectly typed.

* Updated CVehicle.
  • Loading branch information
gir489returns authored Aug 17, 2024
1 parent b9b832a commit aebd695
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
Binary file modified gtav.rcnet
Binary file not shown.
23 changes: 12 additions & 11 deletions network/netObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ namespace rage
public:
int16_t m_object_type; //0x0008
int16_t m_object_id; //0x000A
char pad_000C[61]; //0x000C
char pad_000C[52]; //0x000C
int8_t m_bubble; //0x0040
char pad_0041[8]; //0x0041
int8_t m_owner_id; //0x0049
int8_t m_control_id; //0x004A
int8_t m_next_owner_id; //0x004B
bool m_is_remote; //0x004C
bool m_wants_to_delete; //0x004D
char pad_004E[1]; //0x004E
bool m_should_not_be_delete; //0x004F
char pad_0050[0x38]; //0x0050
int m_ownership_token; //0x0088
int8_t m_wants_to_be_owner; //0x004A
bool m_is_remote; //0x004B
uint16_t m_flags_one; //0x004C
uint16_t m_flags_two; //0x004E
class CObject* m_game_object; //0x0050
char pad_0058[48]; //0x0058
uint32_t m_ownership_token; //0x0088

DEFINE_RAGE_RTTI(rage::netObject)

Expand Down Expand Up @@ -131,7 +132,7 @@ namespace rage
virtual void m_318() = 0;
virtual void m_320() = 0;
virtual void UpdatePendingVisibilityChanges() = 0;
}; //Size: 0x0050
static_assert(sizeof(netObject) == 0x8C); // incorrect, but will do for now
}; //Size: 0x008C
static_assert(sizeof(netObject) == 0x8C);
}
#pragma pack(pop)
26 changes: 22 additions & 4 deletions vehicle/CVehicle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@
#include <cmath>

#pragma pack(push, 1)
class CDeformation
{
public:
char pad_0000[732]; //0x0000
}; //Size: 0x02DC
static_assert(sizeof(CDeformation) == 0x2DC);

class CVehicleDamage
{
public:
char pad_0000[16]; //0x0000
class CDeformation m_deformation; //0x0010
char pad_02EC[284]; //0x02EC
class CVehicle* m_vehicle; //0x0408
float m_body_health; //0x0410
float m_petrol_tank_health; //0x0414
}; //Size: 0x0418
static_assert(sizeof(CVehicleDamage) == 0x418);


class CVehicle : public rage::CPhysical
{
public:
Expand All @@ -20,9 +40,8 @@ class CVehicle : public rage::CPhysical
char pad_0308[152]; //0x0308
float m_jump_boost_charge; //0x03A0
bool m_can_boost_jump; //0x03A4
char pad_03A5[1163]; //0x03A5
float m_body_health; //0x0830
float m_petrol_tank_health; //0x0834
char pad_03A5[123]; //0x03A5
class CVehicleDamage m_vehicle_damage; //0x0420
char pad_0838[72]; //0x0838
int16_t m_next_gear; //0x0880
int16_t m_current_gear; //0x0882
Expand Down Expand Up @@ -57,7 +76,6 @@ class CVehicle : public rage::CPhysical
char pad_0D20[1696]; //0x0D20
uint32_t m_door_lock_status; //0x13C0
char pad_13C4[2356]; //0x13C4

}; //Size: 0x1CF8
static_assert(sizeof(CVehicle) == 0x1CF8);
#pragma pack(pop)

0 comments on commit aebd695

Please sign in to comment.