- Status
- Offline
- Joined
- Mar 3, 2026
- Messages
- 421
- Reaction score
- 7
Digging into dual-wielding logic in Warface? If you've been struggling to pull the sub-weapon pointer (L hand) correctly, you need to navigate the CInventory and CWeaponSettings classes properly. This isn't just about simple offsets; it's about how CryEngine handles the inventory container and weapon extensions.
Core Classes and Offsets
To get started, you'll need the correct offsets for CActor and its inventory. In my experience, most pastes fail because they ignore the SInventoryStats structure logic.
The Logic Chain
To reach the sub-weapon name, you have to traverse from the CItem through the weapon extension and finally into the base settings.
Implementation Example
Here is how you actually verify if dual-wield mode is active and grab that secondary pointer:
Keep in mind that GetItemByName should be checking against the item class name, not just the string, to avoid mismatches. If you're building an internal, this is the cleanest way to handle dual-wield visuals or state checks without guessing.
Anyone else found a faster way to iterate the inventory slots for specific attachments?
Core Classes and Offsets
To get started, you'll need the correct offsets for CActor and its inventory. In my experience, most pastes fail because they ignore the SInventoryStats structure logic.
Code:
class CActor : public IActor, CPlayer, IGameObjectExtension
{
CInventory* m_pInventory; // 0x0038
};
Code:
using EntityId = uint32;
struct SInventoryStats {
TInventoryVector slots; // 0x0000
char pad_0018[24]; // 0x0018
TAmmoInfoMap ammoInfo; // 0x0030
char pad_0040[56]; // 0x0040
TAmmoInfoIt ammoIterator; // 0x0078
char pad_0080[8]; // 0x0080
EntityId currentItemId; // 0x0088
EntityId holsteredItemId; // 0x008C
EntityId lastItemId; // 0x0090
};
class CInventory : public IInventory, IGameObjectExtension {
// m_stats offset: 0x0028
// AOB: 85 D2 ? ? 48 8B 41 ? 48 8B 49 ? 48 2B C8 4C 63 C2 48 C1 F9 ?
SInventoryStats m_stats;
};
The Logic Chain
To reach the sub-weapon name, you have to traverse from the CItem through the weapon extension and finally into the base settings.
- Identify the current item ID from the inventory stats (0x88).
- Get the CItem pointer from the item system.
- Access m_weaponExt at 0x38.
- Pull CWeaponSettings from the extension at 0x48.
- Finally, find m_subWeapon (CryStringT) at 0xA18.
Implementation Example
Here is how you actually verify if dual-wield mode is active and grab that secondary pointer:
Code:
if (auto pInventory = pClientActor->m_pInventory) {
if (auto pCurrItem = pItemSystem->GetItem(pInventory->GetCurrentItemId())) {
// pCurrItem - ptr to current weapon (R hand)
auto pWeaponExtR = pCurrItem->m_weaponExt;
if (!pWeaponExtR || !pWeaponExtR->m_settings) return;
auto subWeapon = pWeaponExtR->m_settings->m_subWeapon;
// Check if dual-wield mode is active
if (subWeapon.empty()) return;
if (auto pSubItem = pInventory->GetItemByName(subWeapon.c_str())) {
// pSubItem - now you have the ptr to the L hand weapon
}
}
}
Keep in mind that GetItemByName should be checking against the item class name, not just the string, to avoid mismatches. If you're building an internal, this is the cleanest way to handle dual-wield visuals or state checks without guessing.
Anyone else found a faster way to iterate the inventory slots for specific attachments?