Fix -1//disabled and JIP issues

This commit is contained in:
PabstMirror 2018-11-02 16:56:16 -05:00
parent 4b1672eaa0
commit d5b3696c02
7 changed files with 12 additions and 8 deletions

View File

@ -9,7 +9,10 @@ GVAR(configTypesAdded) = [];
}] call CBA_fnc_addEventHandler;
["ace_unconscious", LINKFUNC(handleUnconscious)] call CBA_fnc_addEventHandler;
[QGVAR(initSupplyVehicle), LINKFUNC(initSupplyVehicle)] call CBA_fnc_addEventHandler;
[QGVAR(initSupplyVehicle), {
TRACE_1("initSupplyVehicle EH",_this); // Warning: this can run before settings are init
[FUNC(initSupplyVehicle), _this] call EFUNC(common,runAfterSettingsInit);
}] call CBA_fnc_addEventHandler;
["vehicle", {
params ["_unit"];

View File

@ -19,10 +19,8 @@
params ["_truck", "_unit"];
(alive _unit)
&& {_unit isKindOf "CAManBase"}
&& {local _unit}
&& {alive _truck}
&& {(_truck distance _unit) < REARM_ACTION_DISTANCE}
&& {GVAR(supply) > 0}
&& {[_unit, _truck, ["IsNotInside"]] call EFUNC(common,canInteractWith)} // manually added actions need this
&& {(_truck getVariable [QGVAR(currentSupply), 0]) >= 0}

View File

@ -19,9 +19,8 @@
params ["_truck", "_unit"];
(alive _unit)
&& {_unit isKindOf "CAManBase"}
&& {local _unit}
&& {!isNull (_unit getVariable [QGVAR(dummy), objNull])}
&& {alive _truck}
&& {(_truck distance _unit) < REARM_ACTION_DISTANCE}
&& {[_unit, _truck, ["IsNotInside"]] call EFUNC(common,canInteractWith)} // manually added actions need this
&& {(_truck getVariable [QGVAR(currentSupply), 0]) >= 0}

View File

@ -19,9 +19,8 @@
params ["_truck", "_unit"];
(alive _unit)
&& {_unit isKindOf "CAManBase"}
&& {local _unit}
&& {alive _truck}
&& {(_truck distance _unit) < REARM_ACTION_DISTANCE}
&& {isNull (_unit getVariable [QGVAR(dummy), objNull])}
&& {[_unit, _truck, ["IsNotInside"]] call EFUNC(common,canInteractWith)} // manually added actions need this
&& {(_truck getVariable [QGVAR(currentSupply), 0]) >= 0}

View File

@ -68,6 +68,8 @@ if (_oldRearmConfig || {_configSupply > 0}) then {
WARNING_1("Actions already present on [%1]. Old Compat PBO?",_typeOf);
};
} else {
if (_vehicle getVariable [QGVAR(objectActionsAdded), false]) exitWith {TRACE_1("Actions already added to object",_vehicle);};
_vehicle setVariable [QGVAR(objectActionsAdded), true];
TRACE_1("Adding Object Actions",_typeOf);
[_vehicle, 0, ["ACE_MainActions"], _actionReadSupplyCounter] call EFUNC(interact_menu,addActionToObject);
[_vehicle, 0, ["ACE_MainActions"], _actionTakeAmmo] call EFUNC(interact_menu,addActionToObject);

View File

@ -20,6 +20,8 @@ params [
["_testVanillaRearm", false, [false]]
];
if ((_target getVariable [QGVAR(currentSupply), 0]) < 0) exitWith {false};
private _vehCfg = configFile >> "CfgVehicles" >> typeOf _target;
private _vanillaCargoConfig = getNumber (_vehCfg >> "transportAmmo");
private _rearmCargoConfig = getNumber (_vehCfg >> QGVAR(defaultSupply));

View File

@ -29,6 +29,7 @@ params [
["_rearmCargo", 0, [0]],
["_addToCurrent", false, [false]]
];
TRACE_3("makeSource",_source,_rearmCargo,_addToCurrent);
if (isNull _source) exitWith {};