Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aleeperezz16 committed Jan 5, 2024
1 parent 518bbc1 commit 163cc62
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions regamedll/dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ NOXREF void EjectBrass2(const Vector &vecOrigin, const Vector &vecVelocity, floa
MESSAGE_END();
}

/*#ifdef REGAMEDLL_ADD
#ifdef REGAMEDLL_ADD
struct {
AmmoType type;
const char *name;
Expand All @@ -211,7 +211,7 @@ struct {
{ AMMO_SMOKEGRENADE, "SmokeGrenade" },
{ AMMO_C4, "C4" },
};
#endif*/
#endif
#ifdef REGAMEDLL_API
BOOL EXT_FUNC RemoveAmmoNameFromAmmoRegistry(const char *szAmmoname)
{
Expand Down Expand Up @@ -251,6 +251,7 @@ int AddAmmoNameToAmmoRegistry(const char *szAmmoname)
return i;
}

// New slot for the ammo it's the first one clear.
if (!CBasePlayerItem::m_AmmoInfoArray[i].iId && newIndex == -1)
{
newIndex = i;
Expand Down Expand Up @@ -284,6 +285,7 @@ int AddAmmoNameToAmmoRegistry(const char *szAmmoname)
if (giAmmoIndex >= MAX_AMMO_SLOTS)
giAmmoIndex = 1;

#ifdef REGAMEDLL_ADD
for (auto& ammo : ammoIndex)
{
if (Q_stricmp(ammo.name, szAmmoname))
Expand All @@ -294,6 +296,7 @@ int AddAmmoNameToAmmoRegistry(const char *szAmmoname)
}
break;
}
#endif

CBasePlayerItem::m_AmmoInfoArray[giAmmoIndex].pszName = szAmmoname;

Expand Down

0 comments on commit 163cc62

Please sign in to comment.