Skip to content

Commit

Permalink
cambio a bool
Browse files Browse the repository at this point in the history
  • Loading branch information
aleeperezz16 committed Jan 4, 2024
1 parent 366331e commit 33e40db
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions regamedll/dlls/API/CAPI_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,8 @@ typedef IHookChainClassImpl<void, CBasePlayer> CReGameHook_CBasePlayer_Observer_
typedef IHookChainRegistryClassImpl<void, CBasePlayer> CReGameHookRegistry_CBasePlayer_Observer_Think;

// PrecacheItemInfo hook
typedef IHookChainImpl<void, struct ItemInfo *> CReGameHook_PrecacheItemInfo;
typedef IHookChainRegistryImpl<void, struct ItemInfo *> CReGameHookRegistry_PrecacheItemInfo;
typedef IHookChainImpl<bool, struct ItemInfo *> CReGameHook_PrecacheItemInfo;
typedef IHookChainRegistryImpl<bool, struct ItemInfo *> CReGameHookRegistry_PrecacheItemInfo;

class CReGameHookchains: public IReGameHookchains {
public:
Expand Down
15 changes: 9 additions & 6 deletions regamedll/dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,10 @@ int AddAmmoNameToAmmoRegistry(const char *szAmmoname)
return giAmmoIndex;
}

void PrecacheItemInfo(ItemInfo *info)

bool EXT_FUNC PrecacheItemInfo(ItemInfo *info)
{

return true;
}

// Precaches the weapon and queues the weapon info for sending to clients
Expand All @@ -286,11 +287,13 @@ void UTIL_PrecacheOtherWeapon(const char *szClassname)
pItem->Precache();
if (pItem->GetItemInfo(&info))
{
g_ReGameHookchains.m_PrecacheItemInfo.callChain(PrecacheItemInfo, &info);
CBasePlayerItem::m_ItemInfoArray[info.iId] = info;
if (g_ReGameHookchains.m_PrecacheItemInfo.callChain(PrecacheItemInfo, &info))
{
CBasePlayerItem::m_ItemInfoArray[info.iId] = info;

AddAmmoNameToAmmoRegistry(info.pszAmmo1);
AddAmmoNameToAmmoRegistry(info.pszAmmo2);
AddAmmoNameToAmmoRegistry(info.pszAmmo1);
AddAmmoNameToAmmoRegistry(info.pszAmmo2);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions regamedll/public/regamedll/regamedll_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Observe
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Observer_Think;

// PrecacheItemInfo hook
typedef IHookChain<void, struct ItemInfo *> IReGameHook_PrecacheItemInfo;
typedef IHookChainRegistry<void, struct ItemInfo *> IReGameHookRegistry_PrecacheItemInfo;
typedef IHookChain<bool, struct ItemInfo *> IReGameHook_PrecacheItemInfo;
typedef IHookChainRegistry<bool, struct ItemInfo *> IReGameHookRegistry_PrecacheItemInfo;

class IReGameHookchains {
public:
Expand Down

0 comments on commit 33e40db

Please sign in to comment.