Reloading works for one weapon, but not the other?

Hey there. I’m trying to work on a script that will allow the player to reload their weapons, as well as pick up an item to increase their ammo. At the moment, it works perfectly as planned on one of my two weapons. My pistol has no issue at all. The player can shoot, and will have updates on how much ammo they have left, as well as can pick up more ammo, and see how much the total amount is. However, for my machine gun, despite the code being the exact same, just different variables, when I pick up ammo, I think it counts for my pistol instead. It doesn’t increase the value for either weapon, but I have a debug.log that will check how much ammo my machinegun has, but it’s only checked when I switch to my pistol for some reason. This is a part of my PlayerMovement script.

using UnityEngine;
using UnityEngine.UI;
public class PlayerMovement : MonoBehaviour {
    
    public bool Alive;
    public WeaponFiring weapon;
    int AmmoIncrease = 100;
    int machineGunIncrease = 200;
    bool pistolAmmoMax;
    bool machineGunAmmoMax;
    int maxPistolAmmo = 200;
    int maxMachineGunAmmo = 600;

    void OnTriggerEnter(Collider col)
    {
           if (col.gameObject.tag == ("pistolAmmo"))
        {
            if (!pistolAmmoMax)
                {
                    weapon.totalPistolAmmo = weapon.totalPistolAmmo + AmmoIncrease;
                    col.gameObject.SetActive(false);
                }
            }
        if(weapon.totalPistolAmmo < maxPistolAmmo)
        {
            pistolAmmoMax = false;
        }
        if(weapon.totalPistolAmmo >= maxPistolAmmo)
        {
            weapon.totalPistolAmmo = maxPistolAmmo;
            pistolAmmoMax = true;
        }
        
        if (col.gameObject.tag == ("machineGunAmmo"))
        {
            if (!machineGunAmmoMax)
            {
                weapon.totalMachineGunAmmo = weapon.totalMachineGunAmmo + machineGunIncrease;
                col.gameObject.SetActive(false);
            }
        }
        if (weapon.totalMachineGunAmmo < maxMachineGunAmmo)
        {
            machineGunAmmoMax = false;
        }
        if (weapon.totalMachineGunAmmo >= maxMachineGunAmmo)
        {
            weapon.totalMachineGunAmmo = maxMachineGunAmmo;
            machineGunAmmoMax = true;
        }
    }        
}

And this is my WeaponFiring script.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class WeaponFiring : MonoBehaviour {
    public enum SelectedWeapon { Pistol, MachineGun}
    public SelectedWeapon selectedWeapon = SelectedWeapon.Pistol;

    public Text AmmoCount;

    public int totalPistolAmmo;
    public int currentPistolAmmo;
           int missingPistolAmmo;
           bool pistolFire;

    public int currentMachineGunAmmo;
    public int totalMachineGunAmmo;
           int missingMachineGunAmmo;
           bool machineGunFire;
   
  
    public AudioClip reloading;
    public AudioClip PistolFire;
    public AudioClip MachineGunFire;
    AudioSource sounds;

    public GameObject bullet;
    public Transform chamber;
    public int bulletSpeed;

    public PlayerMovement player;


    void Start()
    {
        sounds = GetComponent<AudioSource>();

        if (selectedWeapon == SelectedWeapon.Pistol)
        {
            totalPistolAmmo = 18;
            currentPistolAmmo = 18;
        }
        if(selectedWeapon == SelectedWeapon.MachineGun)
        {
            totalMachineGunAmmo = 31;
            currentMachineGunAmmo = 31;
        }
    }

    // Use this for initialization
    void PistolFiring()
    {
        if (player.Alive)
        {
            if (selectedWeapon == SelectedWeapon.Pistol)
            {
                AmmoCount.text = currentPistolAmmo + "/" + totalPistolAmmo;
                if (pistolFire)
                {
                    if (Input.GetMouseButtonDown(0) && currentPistolAmmo >= 1)
                    {
                        var bulletFired = Instantiate(bullet, chamber.position, chamber.rotation);
                        bulletFired.GetComponent<Rigidbody>().velocity = bulletFired.transform.forward * bulletSpeed;

                        sounds.PlayOneShot(PistolFire);
                        currentPistolAmmo--;
                        missingPistolAmmo++;
                    }
                    if (Input.GetKeyDown(KeyCode.R))
                    {
                        sounds.PlayOneShot(reloading);
                        totalPistolAmmo = totalPistolAmmo - missingPistolAmmo;
                        currentPistolAmmo = 18;
                        missingPistolAmmo = 0;
                    }
                }
                if(totalPistolAmmo < 18)
                {
                 if(currentPistolAmmo > totalPistolAmmo)
                    {
                        currentPistolAmmo = totalPistolAmmo;
                    } 
                }
                if(totalPistolAmmo <= 0)
                {
                    pistolFire = false;
                    totalPistolAmmo = 0;
                    currentPistolAmmo = 0;

                }
                if(totalPistolAmmo >= 1)
                {
                    pistolFire = true;
                }
                if(currentPistolAmmo <= 0)
                {
                    missingPistolAmmo = 18;
                }
            }
        }
    }
   void MachineGunFiring()
    {
        if (player.Alive)
        {
            if (selectedWeapon == SelectedWeapon.MachineGun)
            {
                AmmoCount.text = currentMachineGunAmmo + "/" + totalMachineGunAmmo;
                if (machineGunFire)
                {
                    if (Input.GetMouseButton(0) && currentMachineGunAmmo >= 1)
                    {
                        var bulletFired = Instantiate(bullet, chamber.position, chamber.rotation);
                        bulletFired.GetComponent<Rigidbody>().velocity = bulletFired.transform.forward * bulletSpeed;

                        sounds.PlayOneShot(PistolFire);
                        currentMachineGunAmmo--;
                        missingMachineGunAmmo++;
                    }
                    if (Input.GetKeyDown(KeyCode.R))
                    {
                        sounds.PlayOneShot(reloading);
                        totalMachineGunAmmo = totalMachineGunAmmo - missingMachineGunAmmo;
                        currentMachineGunAmmo = 31;
                        missingMachineGunAmmo = 0;
                    }
                }
                if (totalMachineGunAmmo < 31)
                {
                    if (currentMachineGunAmmo > totalMachineGunAmmo)
                    {
                        currentMachineGunAmmo = totalMachineGunAmmo;
                    }
                }
                if (totalMachineGunAmmo <= 0)
                {
                    machineGunFire = false;
                    totalMachineGunAmmo = 0;
                    currentMachineGunAmmo = 0;

                }
                if (totalMachineGunAmmo >= 1)
                {
                    machineGunFire = true;
                }
            }
        }
    }

    void Update () {
        PistolFiring();
        MachineGunFiring();
        Debug.Log("PistolFire is " + pistolFire);
        Debug.Log("MachineGunFire is " + machineGunFire);
        Debug.Log(totalMachineGunAmmo);
	}
}

If I have extra curly brace, or anything that is missing in the first script, it was from removing any piece of unrelated code.
I’ve been looking over it again and again, but I can’t seem to find where the issue lies. Any help is appreciated.

All of your code seems to be in an if statement that relates to the pistol :

if (col.gameObject.tag == (“pistolAmmo”))