Force Vehicle Save after adding / removing Mags

This commit is contained in:
He-Man 2017-10-06 14:01:29 +02:00
parent 8a4ab15fd1
commit f9a5c29fa8
2 changed files with 11 additions and 0 deletions

View File

@ -52,5 +52,10 @@ else {
{
_return = _x call EPOCH_fnc_addMagazineOverflow;
} foreach _readd;
_vehicle call EPOCH_interact;
if !(EPOCH_arr_interactedObjs isEqualTo[]) then {
[EPOCH_arr_interactedObjs] remoteExec['EPOCH_server_save_vehicles', 2];
EPOCH_arr_interactedObjs = [];
};
[format["Added 1 can %1 with %2 rounds to %3",getText (configFile >> 'CfgMagazines' >> _ammo >> 'displayName'),_magAmmoCount,getText (configFile >> 'CfgWeapons' >> _weaponTurret >> 'displayName')],5] call Epoch_message;
};

View File

@ -26,6 +26,12 @@ _vehicle removeMagazinesTurret [_ammo,_turretPath];
reload _vehicle;
_return = [_ammo,_magAmmoCount] call EPOCH_fnc_addMagazineOverflow;
_vehicle call EPOCH_interact;
if !(EPOCH_arr_interactedObjs isEqualTo[]) then {
[EPOCH_arr_interactedObjs] remoteExec['EPOCH_server_save_vehicles', 2];
EPOCH_arr_interactedObjs = [];
};
_magtxt = getText (configFile >> 'CfgMagazines' >> _ammo >> 'displayName');
_weapontxt = getText (configFile >> 'CfgWeapons' >> _weaponTurret >> 'displayName');
_msg = switch _return do {