updated CItemInfo (#160)

This commit is contained in:
Quentin 2024-02-20 23:58:42 +01:00 committed by GitHub
parent 057df5ceda
commit 078919f9cd
3 changed files with 49 additions and 25 deletions

View File

@ -20,5 +20,5 @@ public:
float m_max_roll_angle_sin; //0x0194 float m_max_roll_angle_sin; //0x0194
float m_lifetime_player_vehicle_locked_override_mp; //0x0198 float m_lifetime_player_vehicle_locked_override_mp; //0x0198
class CHomingRocketParams m_homing_rocket_params; //0x019C class CHomingRocketParams m_homing_rocket_params; //0x019C
}; // Size: 0x01BC }; // Size: 0x1C0
static_assert(sizeof(CAmmoRocketInfo) == 0x1BC); static_assert(sizeof(CAmmoRocketInfo) == 0x1C0);

View File

@ -9,5 +9,5 @@ class CAmmoThrownInfo : CAmmoProjectileInfo
float m_thrown_force; //0x0170 float m_thrown_force; //0x0170
float m_thrown_force_from_vehicle; //0x0174 float m_thrown_force_from_vehicle; //0x0174
int32_t m_ammo_max_mp_bonus; //0x0178 int32_t m_ammo_max_mp_bonus; //0x0178
}; // Size: 0x017C }; // Size: 0x0180
static_assert(sizeof(CAmmoThrownInfo) == 0x17C); static_assert(sizeof(CAmmoThrownInfo) == 0x180);

View File

@ -2,13 +2,37 @@
#include <cstdint> #include <cstdint>
class parStructure;
// https://github.com/Parik27/V.Rainbomizer/blob/0c70868626411a1d30483339003b9985b0ff1c98/lib/CItemInfo.hh
class CItemInfo class CItemInfo
{ {
public: public:
char pad_0000[16]; //0x0000 char pad_0000[8]; //0x0000
uint32_t m_name; //0x0010 uint32_t m_name; //0x0010
uint32_t m_model; //0x0014 uint32_t m_model; //0x0014
uint32_t m_audio; //0x0018 uint32_t m_audio; //0x0018
uint32_t m_slot; //0x001C uint32_t m_slot; //0x001C
}; //Size: 0x0020
private:
virtual void destructor();
virtual bool GetIsClassId(uint32_t hash);
// virtual uint32_t* GetClassId(); (older versions)
virtual uint32_t* _GetClassId(uint32_t* out);
// Not present in older versions of GTA V
virtual uint32_t* GetBaseClassId(uint32_t& out);
// as a result, these functions are shifted by 1 function in the vftable.
virtual uint32_t GetModel();
virtual parStructure* parser_GetStructure();
public:
uint32_t GetClassId()
{
return static_cast<uint32_t>(uintptr_t(_GetClassId(nullptr)));
}
};
static_assert(sizeof(CItemInfo) == 0x20); static_assert(sizeof(CItemInfo) == 0x20);