fnc_reloadWeaponOnFirstSelected.sqf 519 B

12345678910111213
  1. params ["_unit", "_weapon"];
  2. diag_log "Handling Disposable Reload";
  3. if(_weapon in RD501_AUTO_RELOAD_ON_EQUIP) then
  4. {
  5. diag_log "Weapon in list";
  6. if(count (secondaryWeaponMagazine _unit) == 0) then {
  7. _magazineName = getArray(configFile >> "CfgWeapons" >> currentWeapon _unit >> "magazines") select 0; // TODO: Cache in postInit
  8. diag_log format["AutoReloading with %1", _magazineName];
  9. _unit removeMagazines _magazineName;
  10. _unit addMagazine _magazineName;
  11. _unit removeSecondaryWeaponItem _magazineName;
  12. };
  13. };