Skip to content

Commit

Permalink
[BM] fix equipping extra ammo for pre-owned weapons
Browse files Browse the repository at this point in the history
needs re-test
  • Loading branch information
Alienmario committed Jul 13, 2024
1 parent f626ed7 commit 12a4e4b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions scripting/include/srccoop/classdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1741,9 +1741,7 @@ methodmap CBasePlayer < CBaseCombatCharacter
return NULL_CBASEENTITY;
}

int iNameOffset = (strncmp(szItemName, "item_weapon_", 12, false) == 0) ? 5 : 0;

CBaseAnimating pItem = CBaseAnimating(GivePlayerItem(this.GetEntIndex(), szItemName[iNameOffset]));
CBaseAnimating pItem = CBaseAnimating(GivePlayerItem(this.GetEntIndex(), szItemName));
if (pItem.IsValid() && !pItem.GetOwner().IsValid())
{
// this would drop on the ground if player cant pick up any more
Expand Down

0 comments on commit 12a4e4b

Please sign in to comment.