Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Native:
- // int PED::_GET_CARRIED_PELT_SKINS(Ped mount, void* outBuf); // 0x6F43C351A5D51E2F
- struct PeltEntry
- {
- Hash itemHash; // inventory item hash passed to SetPeltForHorseByInventoryItem
- Hash albedoHash; // albedo texture hash
- Hash normalHash; // normal map hash
- };
- // Returns number of pelts written (0..3). out[] gets only valid entries (itemHash != 0).
- inline int GetCarriedPeltSkins(Ped mount, PeltEntry out[3])
- {
- alignas(8) std::uint8_t buf[0x78]{}; // 120 bytes total (header + 3 entries)
- *reinterpret_cast<int*>(buf) = 3; // header: max pelts to query (IDA: *a2)
- // second header int (at +4) is reserved/unused; leave zero.
- int count = PED::_GET_CARRIED_PELT_SKINS(mount, buf);
- if (count > 3) count = 3;
- // Each entry is 10 ints (40 bytes), starting at byte offset 8.
- // Within an entry (int indices): [0]=item, [2]=albedo, [4]=normal (padding between).
- for (int i = 0, w = 0; i < count && w < 3; ++i)
- {
- const int* base = reinterpret_cast<const int*>(buf + 8 + i * 40);
- Hash item = static_cast<Hash>(base[0]); // item hash
- Hash albedo = static_cast<Hash>(base[2]); // albedo hash
- Hash normal = static_cast<Hash>(base[4]); // normal hash
- if (item != 0) // skip empty slots (engine can return 0)
- {
- out[w++] = { item, albedo, normal };
- }
- }
- return count; // how many pelts were **considered** (0..3). Empty entries have `itemHash==0`.
- }
Add Comment
Please, Sign In to add comment