mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-26 22:55:41 +03:00
Enhanced CCSPlayerItem::GetItemInfo
This commit is contained in:
parent
3f6d9db420
commit
593d1e1450
@ -32,3 +32,9 @@ EXT_FUNC void CCSPlayerItem::SetItemInfo(ItemInfo *pInfo)
|
||||
{
|
||||
Q_memcpy(&m_ItemInfo, pInfo, sizeof(m_ItemInfo));
|
||||
}
|
||||
|
||||
EXT_FUNC int CCSPlayerItem::GetItemInfo(ItemInfo *pInfo)
|
||||
{
|
||||
Q_memcpy(pInfo, &m_ItemInfo, sizeof(*pInfo));
|
||||
return 1;
|
||||
}
|
||||
|
@ -4783,7 +4783,12 @@ int EXT_FUNC GetWeaponData(edict_t *pEdict, struct weapon_data_s *info)
|
||||
// Get The ID
|
||||
ItemInfo II;
|
||||
Q_memset(&II, 0, sizeof(II));
|
||||
|
||||
#ifdef REGAMEDLL_API
|
||||
pPlayerItem->CSPlayerItem()->GetItemInfo(&II);
|
||||
#else
|
||||
weapon->GetItemInfo(&II);
|
||||
#endif
|
||||
|
||||
if (II.iId >= 0 && II.iId < MAX_WEAPONS)
|
||||
{
|
||||
@ -4916,7 +4921,13 @@ void EXT_FUNC UpdateClientData(const edict_t *ent, int sendweapons, struct clien
|
||||
Q_memset(&II, 0, sizeof(II));
|
||||
|
||||
CBasePlayerWeapon *weapon = (CBasePlayerWeapon *)pPlayer->m_pActiveItem->GetWeaponPtr();
|
||||
if (weapon && weapon->UseDecrement() && weapon->GetItemInfo(&II))
|
||||
if (weapon && weapon->UseDecrement() &&
|
||||
#ifdef REGAMEDLL_API
|
||||
weapon->CSPlayerItem()->GetItemInfo(&II)
|
||||
#else
|
||||
weapon->GetItemInfo(&II)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
cd->m_iId = II.iId;
|
||||
|
||||
|
@ -1383,7 +1383,11 @@ void CBasePlayer::PackDeadPlayerItems()
|
||||
ItemInfo info;
|
||||
if (pPlayerItem->iItemSlot() < KNIFE_SLOT && !bShieldDropped)
|
||||
{
|
||||
#ifdef REGAMEDLL_API
|
||||
if (pPlayerItem->CSPlayerItem()->GetItemInfo(&info))
|
||||
#else
|
||||
if (pPlayerItem->GetItemInfo(&info))
|
||||
#endif
|
||||
{
|
||||
if (info.iWeight > nBestWeight)
|
||||
{
|
||||
|
@ -38,6 +38,7 @@ public:
|
||||
}
|
||||
|
||||
virtual void SetItemInfo(ItemInfo *pInfo);
|
||||
virtual int GetItemInfo(ItemInfo *pInfo);
|
||||
|
||||
CBasePlayerItem *BasePlayerItem() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user