var playerPawnValue = player.PlayerPawn.Value;
if (playerPawnValue == null || !playerPawnValue.IsValid) return;
var activeWeapon = playerPawnValue.WeaponServices?.ActiveWeapon.Get();
if (activeWeapon == null) return;
if (string.Equals(activeWeapon?.DesignerName, matchedWeapon))
{
// 如果你手上的武器已经是期望武器了, 直接丢下来
player.DropActiveWeapon();
gunGeneratedCnt++;
// 丢下来之后再给这把武器
player.GiveNamedItem(matchedWeapon);
}