diff --git a/addons/common/fnc_directCall.sqf b/addons/common/fnc_directCall.sqf index d4eda2224..92df23c2b 100644 --- a/addons/common/fnc_directCall.sqf +++ b/addons/common/fnc_directCall.sqf @@ -22,14 +22,14 @@ Author: commy2 ---------------------------------------------------------------------------- */ -params [["_CBA_code", {}, [{}]], ["_this", []]]; +params [["_CBA_code", {}, [{}]], ["_args", []]]; private "_CBA_return"; isNil { // Wrap the _CBA_code in an extra call block to prevent problems with exitWith and apply //IGNORE_PRIVATE_WARNING ["_x"]; - _CBA_return = ([_x] apply {call _CBA_code}) select 0; + _CBA_return = ([_x] apply {_args call _CBA_code}) select 0; }; if (!isNil "_CBA_return") then {_CBA_return}; diff --git a/addons/ui/fnc_openItemContextMenu.sqf b/addons/ui/fnc_openItemContextMenu.sqf index 3fcf6b71d..12d9f49e7 100644 --- a/addons/ui/fnc_openItemContextMenu.sqf +++ b/addons/ui/fnc_openItemContextMenu.sqf @@ -111,11 +111,11 @@ private _unit = call CBA_fnc_currentUnit; // Execute context menu option statement on selection. _list setVariable [QFUNC(activate), { params ["_list", "_index"]; - _list getVariable (_list lbData _index) params ["_condition", "_statement", "_consume", "_this"]; + _list getVariable (_list lbData _index) params ["_condition", "_statement", "_consume", "_args"]; - if (_this call _condition) then { + if (_args call _condition) then { if (_consume) then { - params ["_unit", "_container", "_item", "_slot"]; + _args params ["_unit", "_container", "_item", "_slot"]; if !([_unit, _item, _slot, _container] call CBA_fnc_consumeItem) then { ERROR_2("Cannot consume item %1 from %2.",_item,_slot); @@ -125,7 +125,7 @@ _list setVariable [QFUNC(activate), { // Call statement and safe check return value. private _keepOpen = [nil] apply { - private _args = [_this, _statement]; + private _args = [_args, _statement]; private ["_list", "_index", "_condition", "_statement", "_consume"]; (_args select 0) call (_args select 1) // return } param [0, false] isEqualTo true; @@ -135,7 +135,7 @@ _list setVariable [QFUNC(activate), { // Keep focus to prevent auto closing. ctrlSetFocus _list; } else { - [{ctrlDelete _this}, _list] call CBA_fnc_execNextFrame; + [{ctrlDelete _args}, _list] call CBA_fnc_execNextFrame; }; }; }]; diff --git a/addons/xeh/fnc_init.sqf b/addons/xeh/fnc_init.sqf index 45db4f488..6025e6054 100644 --- a/addons/xeh/fnc_init.sqf +++ b/addons/xeh/fnc_init.sqf @@ -21,33 +21,33 @@ Author: commy2 ---------------------------------------------------------------------------- */ -params ["_this"]; +params ["_object"]; -if (_this call CBA_fnc_isTerrainObject) exitWith { - INFO_2("Abort init event for terrain object %1. Class: %2.",_this,typeOf _this); +if (_object call CBA_fnc_isTerrainObject) exitWith { + INFO_2("Abort init event for terrain object %1. Class: %2.",_object,typeOf _object); }; -if !(ISINITIALIZED(_this)) then { - SETINITIALIZED(_this); +if !(ISINITIALIZED(_object)) then { + SETINITIALIZED(_object); // run Init { - [_this] call _x; - } forEach (_this getVariable QGVAR(init)); + [_object] call _x; + } forEach (_object getVariable QGVAR(init)); // run InitPost or put on stack if (SLX_XEH_MACHINE select 8) then { [{ { - [_this] call _x; - } forEach (_this getVariable QGVAR(initPost)); - }, _this] call CBA_fnc_execNextFrame; + [_object] call _x; + } forEach (_object getVariable QGVAR(initPost)); + }, _object] call CBA_fnc_execNextFrame; } else { - GVAR(initPostStack) pushBack _this; + GVAR(initPostStack) pushBack _object; }; // fix for respawnVehicle clearing the object namespace - _this addEventHandler ["Respawn", { + _object addEventHandler ["Respawn", { params ["_vehicle", "_wreck"]; if (ISINITIALIZED(_vehicle)) exitWith {}; // Exit if unit respawned normaly with copied variables (e.g. humans) diff --git a/addons/xeh/fnc_postInit.sqf b/addons/xeh/fnc_postInit.sqf index 09d0417f1..0f2fe579c 100644 --- a/addons/xeh/fnc_postInit.sqf +++ b/addons/xeh/fnc_postInit.sqf @@ -45,11 +45,11 @@ isNil { // do InitPost { - _x params ["_this"]; + _x params ["_object"]; { - [_this] call _x; - } forEach (_this getVariable QGVAR(initPost)); + [_object] call _x; + } forEach (_object getVariable QGVAR(initPost)); } forEach GVAR(initPostStack); GVAR(initPostStack) = nil;