TTT - Clip Max Modification

Would there be a way to modify TTT so clip max actually works with different weapons? Some TTT weapons state to mirror clip max with ammo. The ammo entity will give 10 ammo and it defines the max ammo given as 20.

So if you set ClipMax for an awp for 15, the ammo ignores that fact and gives 20 as the maximum ammo.


function ENT:Touch(ent)
   if SERVER and self.taken != true then
      if (ent:IsValid() and ent:IsPlayer() and self:CheckForWeapon(ent) and self:PlayerCanPickup(ent)) then

         local ammo = ent:GetAmmoCount(self.AmmoType)
         -- need clipmax info and room for at least 1/4th
         if self.AmmoMax >= (ammo + math.ceil(self.AmmoAmount * 0.25)) then
            local given = self.AmmoAmount
            given = math.min(given, self.AmmoMax - ammo)
            ent:GiveAmmo( given, self.AmmoType)

            self:Remove()

            -- just in case remove does not happen soon enough
            self.taken = true
         end
      end
   end
end


That’s part of the base ammo TTT code. I believe this could be modified to fix the issue.

Would it be possible to do something that would check SWEP.Primary.ClipMax and then only give that max ammo for that gun? Since TTT shares ammo types, the only other issue I would see is picking up a weapon with a higher max ammo. Although I suppose you could subtract that ammo when you switch to a weapon with a lower clip max.