Merge pull request #2283 from acemod/cargoCanInteract

Add canInteractWith checks for cargo
This commit is contained in:
Glowbal 2015-08-29 11:45:50 +02:00
commit 70c0edf436
2 changed files with 6 additions and 1 deletions

View File

@ -18,6 +18,8 @@
params ["_player", "_object"];
if (!([_player, _object, []] call EFUNC(common,canInteractWith))) exitWith {false};
private ["_nearestVehicle"];
_nearestVehicle = [_player] call FUNC(findNearestVehicle);

View File

@ -39,7 +39,10 @@ SETMVAR(GVAR(initializedClasses),_initializedClasses);
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {};
private ["_text", "_condition", "_statement", "_icon", "_action"];
_condition = {GVAR(enable)};
_condition = {
params ["_target", "_player"];
GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)}
};
_text = localize LSTRING(openMenu);
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};
_icon = "";