mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added ace_rearm_sourceInitialized
event (#9134)
This commit is contained in:
parent
28e8e7d4ca
commit
1693e6834d
@ -43,14 +43,16 @@ _source setVariable [QGVAR(currentSupply), _currentSupply + _rearmCargo, true];
|
||||
|
||||
private _rearmCargoConfig = getNumber (configOf _source >> QGVAR(defaultSupply));
|
||||
|
||||
// already initialized because this is a config rearm vehicle
|
||||
if (_rearmCargoConfig > 0 || _source getVariable [QGVAR(isSupplyVehicle), false]) exitWith {};
|
||||
// initialize if it's not a config rearm vehicle
|
||||
if (!(_rearmCargoConfig > 0 && _source getVariable [QGVAR(isSupplyVehicle), false])) then {
|
||||
_source setVariable [QGVAR(isSupplyVehicle), true, true];
|
||||
|
||||
_source setVariable [QGVAR(isSupplyVehicle), true, true];
|
||||
// only add if menu does not already exist
|
||||
if (isNil {_source getVariable QGVAR(initSupplyVehicle_jipID)}) then {
|
||||
private _jipID = [QGVAR(initSupplyVehicle), [_source]] call CBA_fnc_globalEventJIP;
|
||||
[_jipID, _source] call CBA_fnc_removeGlobalEventJIP;
|
||||
_source setVariable [QGVAR(initSupplyVehicle_jipID), _jipID];
|
||||
};
|
||||
};
|
||||
|
||||
// check if menu already exists
|
||||
if (!isNil {_source getVariable QGVAR(initSupplyVehicle_jipID)}) exitWith {};
|
||||
|
||||
private _jipID = [QGVAR(initSupplyVehicle), [_source]] call CBA_fnc_globalEventJIP;
|
||||
[_jipID, _source] call CBA_fnc_removeGlobalEventJIP;
|
||||
_source setVariable [QGVAR(initSupplyVehicle_jipID), _jipID];
|
||||
[QGVAR(rearmSourceInitalized), [_source]] call CBA_fnc_globalEvent;
|
||||
|
@ -235,3 +235,9 @@ This function sets the current supply count of the ammo truck. It can be used to
|
||||
---| --------- | -----------
|
||||
0 | `ammo_truck` | My ammo truck object
|
||||
1 | `1000`| Supply Count
|
||||
|
||||
## 4. Events
|
||||
|
||||
| Name | Arguments | Global? | Added in |
|
||||
| ------------- | ------------- | ------------- |
|
||||
| ace_rearm_sourceInitalized | Yes | Ammo truck (OBJECT) | 3.16.0 |
|
||||
|
Loading…
Reference in New Issue
Block a user