//If function is called with an optional string then check if player has that magzine otherwise check all magazines of the player to see if they are compatible with the static weapon
if (_magazineClassOptional != "") then {
if ([_unit,_magazineClassOptional] call EFUNC(common,hasMagazine)) then {
//If static weapon has a magazine then find the ammo count
if ((count (_static magazinesTurret [0])) > 0)then{
_count = _currentMagazine select 2;
};
//If the static weapon doesn't have a magzine or a magazine with no bullets, the player has a compatible magazine and the static weapon has a barrel then you can load a magazine
if ( ( ((count (_static magazinesTurret [0])) == 0) || (_count == 0) ) && _hasCompatibleMagazine) then {