-- This makes the possibility of open chamber and removed magazine guns super easy but we'll burn that bridge when we get there.

-- The table that holds all the methods
VFEWeaponModelTable = {}

-- Main function. Test for support, if not we reset weapon to original model
function VFESetWeaponModel(weapon, open)
	for index, modelfunction in ipairs(VFEWeaponModelTable) do
		if modelfunction.Name == weapon:getFullType() then
			modelfunction.Apply(weapon, open)
			return
		end	
	end
	weapon:setWeaponSprite(weapon:getOriginalWeaponSprite())
end

-- Mini tables contain the name of the weapon it is for and a method to actually change the weapon
local HuntingRifle = {}
HuntingRifle.Name = "Base.HuntingRifle"
HuntingRifle.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	local canon = weapon:getCanon()
	if canon ~= nil then
		if canon:getType() == "Bipod" then
			originalSprite = originalSprite .. "BP"
		end
	end
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, HuntingRifle);

local VarmintRifle = {}
VarmintRifle.Name = "Base.VarmintRifle"
VarmintRifle.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	local canon = weapon:getCanon()
	if canon ~= nil then
		if canon:getType() == "Bipod" then
			originalSprite = originalSprite .. "BP"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, VarmintRifle);

local SniperRifle = {}
SniperRifle.Name = "Base.SniperRifle"
SniperRifle.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local canon = weapon:getCanon()
	if canon ~= nil then
		if canon:getType() == "Bipod" then
			originalSprite = originalSprite .. "BP"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, SniperRifle);

local Spas12 = {}
Spas12.Name = "Base.Spas12"
Spas12.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local pad = weapon:getRecoilpad()
	if pad ~= nil then
		if pad:getType() == "ShellHolder" then
			originalSprite = originalSprite .. "SH"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, Spas12);

local Spas12Folded = {}
Spas12Folded.Name = "Base.Spas12Folded"
Spas12Folded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local pad = weapon:getRecoilpad()
	if pad ~= nil then
		if pad:getType() == "ShellHolder" then
			originalSprite = originalSprite .. "SH"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, Spas12Folded);

local AK47 = {}
AK47.Name = "Base.AK47"
AK47.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled762" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled762_Hidden")
				weapon:attachWeaponPart(part)
			end
		end
	else 
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled762_Hidden" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled762")
				weapon:attachWeaponPart(part)
			end
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, AK47);

local AK47Unfolded = {}
AK47Unfolded.Name = "Base.AK47Unfolded"
AK47Unfolded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled762" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled762_Hidden")
				weapon:attachWeaponPart(part)
			end
		end
	else 
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled762_Hidden" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled762")
				weapon:attachWeaponPart(part)
			end
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, AK47Unfolded);

local AK47Folded = {}
AK47Folded.Name = "Base.AK47Folded"
AK47Folded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled762" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled762_Hidden")
				weapon:attachWeaponPart(part)
			end
		end
	else 
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled762_Hidden" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled762")
				weapon:attachWeaponPart(part)
			end
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, AK47Folded);

local MAK90 = {}
MAK90.Name = "Base.MAK90"
MAK90.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled762" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled762_Hidden")
				weapon:attachWeaponPart(part)
			end
		end
	else 
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled762_Hidden" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled762")
				weapon:attachWeaponPart(part)
			end
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, MAK90);

local Mini14 = {}
Mini14.Name = "Base.Mini14"
Mini14.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, Mini14);

local Mini14Unfolded = {}
Mini14Unfolded.Name = "Base.Mini14Unfolded"
Mini14Unfolded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, Mini14Unfolded);

local Mini14Folded = {}
Mini14Folded.Name = "Base.Mini14Folded"
Mini14Folded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, Mini14Folded);


local SKS = {}
SKS.Name = "Base.SKS"
SKS.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	local canon = weapon:getCanon()
	if canon ~= nil then
		if canon:getType() == "Bipod" then
			originalSprite = originalSprite .. "BP"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, SKS);

local R1022 = {}
R1022.Name = "Base.1022"
R1022.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, R1022);

local AssaultRifle2 = {}
AssaultRifle2.Name = "Base.AssaultRifle2"
AssaultRifle2.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	local canon = weapon:getCanon()
	if canon ~= nil then
		if canon:getType() == "Bipod" then
			originalSprite = originalSprite .. "BP"
		end
	end
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, AssaultRifle2);

local AssaultRifle = {}
AssaultRifle.Name = "Base.AssaultRifle"
AssaultRifle.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled556" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled556_Hidden")
				weapon:attachWeaponPart(part)
			end
		end
	else 
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled556_Hidden" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled556")
				weapon:attachWeaponPart(part)
			end
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, AssaultRifle);

local CAR15 = {}
CAR15.Name = "Base.CAR15"
CAR15.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled556" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled556_Hidden")
				weapon:attachWeaponPart(part)
			end
		end
	else 
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled556_Hidden" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled556")
				weapon:attachWeaponPart(part)
			end
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, CAR15);

local CAR15Folded = {}
CAR15Folded.Name = "Base.CAR15Folded"
CAR15Folded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled556" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled556_Hidden")
				weapon:attachWeaponPart(part)
			end
		end
	else 
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled556_Hidden" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled556")
				weapon:attachWeaponPart(part)
			end
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, CAR15Folded);

local CAR15D = {}
CAR15D.Name = "Base.CAR15D"
CAR15D.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled556" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled556_Hidden")
				weapon:attachWeaponPart(part)
			end
		end
	else 
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled556_Hidden" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled556")
				weapon:attachWeaponPart(part)
			end
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, CAR15D);

local MP5 = {}
MP5.Name = "Base.MP5"
MP5.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, MP5);

local MP5SD = {}
MP5SD.Name = "Base.MP5SD"
MP5SD.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, MP5SD);

local MP5Folded = {}
MP5Folded.Name = "Base.MP5Folded"
MP5Folded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, MP5Folded);

local MP5Unfolded = {}
MP5Unfolded.Name = "Base.MP5Unfolded"
MP5Unfolded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, MP5Unfolded);

local UziFolded = {}
UziFolded.Name = "Base.UziFolded"
UziFolded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, UziFolded);

local UziUnfolded = {}
UziUnfolded.Name = "Base.UziUnfolded"
UziUnfolded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, UziUnfolded);

local MAC10Folded = {}
MAC10Folded.Name = "Base.MAC10Folded"
MAC10Folded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, MAC10Folded);

local MAC10Unfolded = {}
MAC10Unfolded.Name = "Base.MAC10Unfolded"
MAC10Unfolded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, MAC10Unfolded);


local CAR15DFolded = {}
CAR15DFolded.Name = "Base.CAR15DFolded"
CAR15DFolded.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled556" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled556_Hidden")
				weapon:attachWeaponPart(part)
			end
		end
	else 
		if ( weapon:getSling()) then
			if weapon:getSling():getFullType() == "Base.Coupled556_Hidden" then
				local part = InventoryItemFactory.CreateItem("Base.Coupled556")
				weapon:attachWeaponPart(part)
			end
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, CAR15DFolded);

local AssaultRifleBayonet = {}
AssaultRifleBayonet.Name = "Base.AssaultRifleBayonet"
AssaultRifleBayonet.Apply = function(weapon, open)
	local modData = weapon:getModData() -- Mod Data
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not modData.rifle.ContainsClip then
		originalSprite = originalSprite .. "_NoMag"
	end

	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, AssaultRifleBayonet);

local AssaultRifleMasterkey = {}
AssaultRifleMasterkey.Name = "Base.AssaultRifleMasterkey"
AssaultRifleMasterkey.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
if VFEWeaponModelTable then
	table.insert(VFEWeaponModelTable, AssaultRifleMasterkey);
end

local AssaultRifleMasterkeyShotgun = {}
AssaultRifleMasterkeyShotgun.Name = "Base.AssaultRifleMasterkeyShotgun"
AssaultRifleMasterkeyShotgun.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local modData = weapon:getModData() -- Mod Data
	if not modData.weapon[1].isContainsClip then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
if VFEWeaponModelTable then
	table.insert(VFEWeaponModelTable, AssaultRifleMasterkeyShotgun);
end

local M60MMG = {}
M60MMG.Name = "Base.M60MMG"
M60MMG.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_Empty"
	end

	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, M60MMG);

local M60MMG_Bipod = {}
M60MMG_Bipod.Name = "Base.M60MMG_Bipod"
M60MMG_Bipod.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_Empty"
	end

	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, M60MMG_Bipod);

local FAL = {}
FAL.Name = "Base.FAL"
FAL.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, FAL);

local FALClassic = {}
FALClassic.Name = "Base.FALClassic"
FALClassic.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, FALClassic);

local Shotgun = {}
Shotgun.Name = "Base.Shotgun"
Shotgun.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	local pad = weapon:getRecoilpad()
	if pad ~= nil then
		if pad:getType() == "ShellHolder" then
			originalSprite = originalSprite .. "SH"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, Shotgun);

local ShotgunSawnoff = {}
ShotgunSawnoff.Name = "Base.ShotgunSawnoff"
ShotgunSawnoff.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	local pad = weapon:getRecoilpad()
	if pad ~= nil then
		if pad:getType() == "ShellHolder" then
			originalSprite = originalSprite .. "SH"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, ShotgunSawnoff);

local ShotgunSawnoffNoStock = {}
ShotgunSawnoffNoStock.Name = "Base.ShotgunSawnoffNoStock"
ShotgunSawnoffNoStock.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local pad = weapon:getRecoilpad()
	if pad ~= nil then
		if pad:getType() == "ShellHolder" then
			originalSprite = originalSprite .. "SH"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, ShotgunSawnoffNoStock);

local Shotgun2 = {}
Shotgun2.Name = "Base.Shotgun2"
Shotgun2.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	local pad = weapon:getRecoilpad()
	if pad ~= nil then
		if pad:getType() == "ShellHolder" then
			originalSprite = originalSprite .. "SH"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, Shotgun2);

local Shotgun2Bayonet = {}
Shotgun2Bayonet.Name = "Base.Shotgun2Bayonet"
Shotgun2Bayonet.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	local pad = weapon:getRecoilpad()
	if pad ~= nil then
		if pad:getType() == "ShellHolder" then
			originalSprite = originalSprite .. "SH"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, Shotgun2Bayonet);

local ShotgunSemi = {}
ShotgunSemi.Name = "Base.ShotgunSemi"
ShotgunSemi.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	local pad = weapon:getRecoilpad()
	if pad ~= nil then
		if pad:getType() == "ShellHolder" then
			originalSprite = originalSprite .. "SH"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, ShotgunSemi);

local ShotgunSemi2 = {}
ShotgunSemi2.Name = "Base.ShotgunSemi2"
ShotgunSemi2.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	local pad = weapon:getRecoilpad()
	if pad ~= nil then
		if pad:getType() == "ShellHolder" then
			originalSprite = originalSprite .. "SH"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, ShotgunSemi2);

local ShotgunSilent = {}
ShotgunSilent.Name = "Base.ShotgunSilent"
ShotgunSilent.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local pad = weapon:getRecoilpad()
	if pad ~= nil then
		if pad:getType() == "ShellHolder" then
			originalSprite = originalSprite .. "SH"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, ShotgunSilent);

local DoubleBarrelShotgun = {}
DoubleBarrelShotgun.Name = "Base.DoubleBarrelShotgun"
DoubleBarrelShotgun.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	if open then
		originalSprite = originalSprite .. "_OPEN"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, DoubleBarrelShotgun);

local DoubleBarrelShotgunSawnoff = {}
DoubleBarrelShotgunSawnoff.Name = "Base.DoubleBarrelShotgunSawnoff"
DoubleBarrelShotgunSawnoff.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	if open then
		originalSprite = originalSprite .. "_OPEN"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, DoubleBarrelShotgunSawnoff);

local DoubleBarrelShotgunSawnoffNoStock = {}
DoubleBarrelShotgunSawnoffNoStock.Name = "Base.DoubleBarrelShotgunSawnoffNoStock"
DoubleBarrelShotgunSawnoffNoStock.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if open then
		originalSprite = originalSprite .. "_OPEN"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, DoubleBarrelShotgunSawnoffNoStock);

local M2400_Shotgun = {}
M2400_Shotgun.Name = "Base.M2400_Shotgun"
M2400_Shotgun.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			if open then
				originalSprite = "M2400FGS_OPEN"
			else
				originalSprite = originalSprite .. "FGS"
			end
		end
	elseif open then
		originalSprite = "M2400_OPEN"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, M2400_Shotgun);

local M2400_Rifle = {}
M2400_Rifle.Name = "Base.M2400_Rifle"
M2400_Rifle.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			if open then
				originalSprite = "M2400FGS_OPEN"
			else
				originalSprite = originalSprite .. "FGS"
			end
		end
	elseif open then
		originalSprite = "M2400_OPEN"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, M2400_Rifle);


local LeverRifle = {}
LeverRifle.Name = "Base.LeverRifle"
LeverRifle.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, LeverRifle);

local LeverRifle2 = {}
LeverRifle2.Name = "Base.LeverRifle2"
LeverRifle2.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, LeverRifle2);

local CampCarbine = {}
CampCarbine.Name = "Base.CampCarbine"
CampCarbine.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	local stock = weapon:getStock()
	if stock ~= nil then
		if stock:getType() == "FiberglassStock" then
			originalSprite = originalSprite .. "FGS"
		end
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, CampCarbine);

local Tec9 = {}
Tec9.Name = "Base.Tec9"
Tec9.Apply = function(weapon, open)
	local originalSprite = weapon:getOriginalWeaponSprite()
	if not weapon:isContainsClip() then
		originalSprite = originalSprite .. "_NoMag"
	end
	weapon:setWeaponSprite(originalSprite)
end
table.insert(VFEWeaponModelTable, Tec9);