then add the following line to your mission config file
class CfgExileCustomCode
{
/*
You can overwrite every single file of our code without touching it.
To do that, add the function name you want to overwrite plus the
path to your custom file here. If you wonder how this works, have a
look at our bootstrap/fn_preInit.sqf function.
Simply add the following scheme here:
<Function Name of Exile> = "<New File Name>";
Example:
ExileClient_util_fusRoDah = "myaddon/myfunction.sqf";
*/
ExileClient_util_gear_repackMagazines = "ExileClient_util_gear_repackMagazines.sqf";
};
the bug was just use of the wrong command removeItems rather than removeMagazines.
The solution has already been on the forums but nobody had made it explicit.
Create a new file in your missions fold called ExileClient_util_gear_repackMagazines.sqf
Copy this contents into it.
/** * Exile Mod * exile.majormittens.co.uk * © 2015 Exile Mod Team * * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ private["_container","_magazineClassName","_ammoToChange","_ammoPerMagazine","_equippedAmmo","_equippedMagazines","_ammoToRefund","_ammoToRefundThisRound"]; _container = _this select 0; _magazineClassName = _this select 1; _ammoToChange = _this select 2; _ammoPerMagazine = getNumber(configFile >> "CfgMagazines" >> _magazineClassName >> "count"); _equippedAmmo = 0; _equippedMagazines = magazinesAmmo _container; if (_ammoPerMagazine > 1) then { { if ((_x select 0) isEqualTo _magazineClassName) then { _equippedAmmo = _equippedAmmo + (_x select 1); }; } forEach _equippedMagazines; _container removeMagazines _magazineClassName; //the fix _ammoToRefund = _equippedAmmo + _ammoToChange; while {_ammoToRefund > 0} do { _ammoToRefundThisRound = _ammoToRefund min _ammoPerMagazine; _container addMagazine [_magazineClassName, _ammoToRefundThisRound]; _ammoToRefund = _ammoToRefund - _ammoToRefundThisRound; }; };then add the following line to your mission config file
class CfgExileCustomCode { /* You can overwrite every single file of our code without touching it. To do that, add the function name you want to overwrite plus the path to your custom file here. If you wonder how this works, have a look at our bootstrap/fn_preInit.sqf function. Simply add the following scheme here: <Function Name of Exile> = "<New File Name>"; Example: ExileClient_util_fusRoDah = "myaddon/myfunction.sqf"; */ ExileClient_util_gear_repackMagazines = "ExileClient_util_gear_repackMagazines.sqf"; };the bug was just use of the wrong command removeItems rather than removeMagazines.
The solution has already been on the forums but nobody had made it explicit.
Edited by FordDefectRedundant Thread
Share this post
Link to post
Share on other sites