Skip to content

Commit

Permalink
missed part in cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Alienmario committed Jul 13, 2024
1 parent 9f044ee commit f626ed7
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions scripting/include/srccoop/checkpoint.inc
Original file line number Diff line number Diff line change
Expand Up @@ -371,27 +371,26 @@ enum struct CCoopEquipment
for (int i = 0; i < size; i++)
{
CCoopWeaponEntry pWeaponEntry;
if (this.m_pWeaponList.GetArray(i, pWeaponEntry, sizeof(pWeaponEntry)))
this.m_pWeaponList.GetArray(i, pWeaponEntry);

if (strncmp(pWeaponEntry.m_szClassname, "weapon_", 7, false) == 0)
{
if (StrContains(pWeaponEntry.m_szClassname, "weapon_", false) == 0)
CBaseCombatWeapon pWeapon = pPlayer.GiveWeapon(pWeaponEntry.m_szClassname);
if (pWeapon.IsValid())
{
CBaseCombatWeapon pWeapon = pPlayer.GiveWeapon(pWeaponEntry.m_szClassname);
if (pWeapon.IsValid())
if (pWeapon.GetPrimaryAmmoType() != -1)
{
if (pWeapon.GetPrimaryAmmoType() != -1)
{
pWeapon.SetPrimaryAmmo(pWeaponEntry.m_iPrimaryAmmo);
}
if (pWeapon.GetSecondaryAmmoType() != -1)
{
pWeapon.SetSecondaryAmmo(pWeaponEntry.m_iSecondaryAmmo);
}
pWeapon.SetPrimaryAmmo(pWeaponEntry.m_iPrimaryAmmo);
}
if (pWeapon.GetSecondaryAmmoType() != -1)
{
pWeapon.SetSecondaryAmmo(pWeaponEntry.m_iSecondaryAmmo);
}
}
else
{
pPlayer.GiveItem(pWeaponEntry.m_szClassname);
}
}
else
{
pPlayer.GiveItem(pWeaponEntry.m_szClassname);
}
}

Expand Down

0 comments on commit f626ed7

Please sign in to comment.