AmmoType atype = (AmmoType)mountedAmmo.getType();  if (mountedAmmo.isAmmoUsable() && !wtype.hasFlag(WeaponType.F_ONESHOT) && atype.getAmmoType() == wtype.getAmmoType() && atype.getRackSize() == wtype.getRackSize()) { mounted.setLinked(mountedAmmo); success = true;
for (Enumeration i = getAmmo(); i.hasMoreElements();) { Mounted mountedAmmo = (Mounted)i.nextElement(); if (loadWeapon(mounted, mountedAmmo)) break;
    public boolean loadWeapon(Mounted mounted, Mounted mountedAmmo) {        boolean success = false;        WeaponType wtype = (WeaponType)mounted.getType();        AmmoType atype = (AmmoType)mountedAmmo.getType();        if (mountedAmmo.isAmmoUsable() &&            !wtype.hasFlag(WeaponType.F_ONESHOT) &&            atype.getAmmoType() == wtype.getAmmoType() &&            atype.getRackSize() == wtype.getRackSize()) {            mounted.setLinked(mountedAmmo);            success = true;        }        return success;    }