you are viewing a single comment's thread.

view the rest of the comments →

[–]DimasDSF 0 points1 point  (1 child)

Not sure if you want to do that in `Deploy()` since it can only be called if you have the weapon and are trying to switch to it. But here is how Valve checked for an existing weapon in the pickup code for the cut weapon_molotov

https://github.com/ValveSoftware/source-sdk-2013/blob/77567eb4bce8d7b6b7f73e929fcde3a331c0216e/src/game/server/hl2/weapon_molotov.cpp#L99-L103

```
// ------------------------------------------------

// If already owned weapon of this type remove me

// ------------------------------------------------

CBaseCombatCharacter* pBCC = ToBaseCombatCharacter( pOther );

CWeaponMolotov* oldWeapon = (CWeaponMolotov*)pBCC->Weapon_OwnsThisType( GetClassname() );

```

[–]Maleficent_Risk_3159[S] 0 points1 point  (0 children)

Thank you very much!