-
Notifications
You must be signed in to change notification settings - Fork 755
General - Optimize isNil/getVariable checks
#11083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,7 @@ params [["_object", objNull, [objNull]], ["_items", true, [[], true]], ["_global | |||||
|
|
||||||
| if (isNull _object) exitWith {}; | ||||||
|
|
||||||
| if (_global && {isMultiplayer} && {isNil {_object getVariable QGVAR(initBoxJIP)}}) then { | ||||||
| if (_global && {isMultiplayer} && {(_object isNil QGVAR(initBoxJIP))}) then { | ||||||
| private _id = [QGVAR(initBox), [_object, _items, false]] call CBA_fnc_globalEventJIP; | ||||||
|
|
||||||
| // Remove JIP EH if object is deleted | ||||||
|
|
@@ -52,7 +52,7 @@ if (_global && {isMultiplayer} && {isNil {_object getVariable QGVAR(initBoxJIP)} | |||||
| [_object, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject); | ||||||
|
|
||||||
| // If items were set globally, do not add items locally | ||||||
| if (isNil {_object getVariable QGVAR(virtualItems)}) then { | ||||||
| if ((_object isNil QGVAR(virtualItems))) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| [_object, _items, false] call FUNC(addVirtualItems); | ||||||
| }; | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,7 +30,7 @@ if (isNil QGVAR(sharedLoadoutsNamespace)) then { | |||||
| publicVariable QGVAR(sharedLoadoutsNamespace); | ||||||
| }; | ||||||
|
|
||||||
| if (isNil {GVAR(sharedLoadoutsNamespace) getVariable QGVAR(sharedLoadoutsVars)}) then { | ||||||
| if ((GVAR(sharedLoadoutsNamespace) isNil QGVAR(sharedLoadoutsVars))) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| GVAR(sharedLoadoutsNamespace) setVariable [QGVAR(sharedLoadoutsVars), [], true]; | ||||||
| }; | ||||||
|
|
||||||
|
|
@@ -42,7 +42,7 @@ if (isNil QGVAR(defaultLoadoutsList)) then { | |||||
| }; | ||||||
| }; | ||||||
|
|
||||||
| if (isNil {profileNamespace getVariable QGVAR(saved_loadouts)}) then { | ||||||
| if ((profileNamespace isNil QGVAR(saved_loadouts))) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| profileNamespace setVariable [QGVAR(saved_loadouts), []]; | ||||||
| }; | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -580,7 +580,7 @@ GVAR(isReloading) = false; | |||||
| call FUNC(swayLoop); | ||||||
| }; | ||||||
| // check for pre-3.16 sway factors being added | ||||||
| if (!isNil {missionNamespace getVariable "ACE_setCustomAimCoef"}) then { | ||||||
| if (!(missionNamespace isNil "ACE_setCustomAimCoef")) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| WARNING("ACE_setCustomAimCoef no longer supported - use ace_common_fnc_addSwayFactor"); | ||||||
| WARNING_1("source: %1",(missionNamespace getVariable "ACE_setCustomAimCoef") apply {_x}); | ||||||
| }; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -26,7 +26,7 @@ if (isNil _settingName) exitWith { | |||||
| }; | ||||||
|
|
||||||
| // Check if the parameter is defined in the module | ||||||
| if (isNil {_logic getVariable _moduleVariable}) exitWith { | ||||||
| if ((_logic isNil _moduleVariable)) exitWith { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| WARNING_2("Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.",typeOf _logic,_moduleVariable); | ||||||
| }; | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -24,7 +24,7 @@ if (isServer) then { | |||||
| addMissionEventHandler ["HandleDisconnect", { | ||||||
| params ["_dcPlayer"]; | ||||||
| TRACE_1("HandleDisconnect eh",_dcPlayer); | ||||||
| if (!isNil {_dcPlayer getVariable QGVAR(playerOwner)}) then { | ||||||
| if (!(_dcPlayer isNil QGVAR(playerOwner))) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| _dcPlayer setVariable [QGVAR(playerOwner), nil, true]; | ||||||
| }; | ||||||
| }]; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -94,7 +94,7 @@ if (hasInterface) then { | |||||
| format ["%1: %2", LLSTRING(itemName), LLSTRING(checkDogtag)], | ||||||
| QPATHTOF(data\dogtag_icon_ca.paa), | ||||||
| {[_player, _target] call FUNC(checkDogtag)}, | ||||||
| {!isNil {_target getVariable QGVAR(dogtagData)}} | ||||||
| {!(_target isNil QGVAR(dogtagData))} | ||||||
| ] call EFUNC(interact_menu,createAction); | ||||||
|
|
||||||
| ["ACE_bodyBagObject", 0, ["ACE_MainActions"], _checkTagAction, true] call EFUNC(interact_menu,addActionToClass); | ||||||
|
|
@@ -104,7 +104,7 @@ if (hasInterface) then { | |||||
| format ["%1: %2", LLSTRING(itemName), LLSTRING(takeDogtag)], | ||||||
| QPATHTOF(data\dogtag_icon_ca.paa), | ||||||
| {[_player, _target] call FUNC(takeDogtag)}, | ||||||
| {(!isNil {_target getVariable QGVAR(dogtagData)}) && {((_target getVariable [QGVAR(dogtagTaken), objNull]) != _target)}} | ||||||
| {(!(_target isNil QGVAR(dogtagData))) && {((_target getVariable [QGVAR(dogtagTaken), objNull]) != _target)}} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ] call EFUNC(interact_menu,createAction); | ||||||
|
|
||||||
| ["ACE_bodyBagObject", 0, ["ACE_MainActions"], _takeTagAction, true] call EFUNC(interact_menu,addActionToClass); | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,7 +21,7 @@ params ["_unit"]; | |||||
| if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {}; | ||||||
|
|
||||||
| // If action is already present, don't add it again | ||||||
| if (!isNil {_unit getVariable QGVAR(releaseActionID)}) exitWith {}; | ||||||
| if (!(_unit isNil QGVAR(releaseActionID))) exitWith {}; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| // Remove drop action | ||||||
| _unit setVariable [QGVAR(releaseActionID), [ | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -34,7 +34,7 @@ if (isServer) then { | |||||
| ["Air", "init", { | ||||||
| if (!GVAR(autoAddFRIES)) exitWith {}; | ||||||
| params ["_vehicle"]; | ||||||
| if (isNumber (configOf _vehicle >> QGVAR(enabled)) && {isNil {_vehicle getVariable [QGVAR(FRIES), nil]}}) then { | ||||||
| if (isNumber (configOf _vehicle >> QGVAR(enabled)) && {(_vehicle isNil QGVAR(FRIES))}) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| [_vehicle] call FUNC(equipFRIES); | ||||||
| }; | ||||||
| }, true, ["ACE_friesBase"], true] call CBA_fnc_addClassEventHandler; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -76,7 +76,7 @@ if (isServer) then { | |||||
| }; | ||||||
|
|
||||||
| // Display burn indicators | ||||||
| if (_unit == ACE_player && {alive _unit} && {isNil {_unit getVariable QGVAR(burnUIPFH)}}) then { // This accounts for player remote controlled a new unit | ||||||
| if (_unit == ACE_player && {alive _unit} && {(_unit isNil QGVAR(burnUIPFH))}) then { // This accounts for player remote controlled a new unit | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| private _burnIndicatorPFH = [LINKFUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler; | ||||||
| _unit setVariable [QGVAR(burnUIPFH), _burnIndicatorPFH]; | ||||||
| }; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -41,10 +41,10 @@ _objects = _objects select { | |||||
| _isValid | ||||||
| }; | ||||||
|
|
||||||
| if (!isNil {missionNamespace getVariable format [QGVAR(Budget_%1), _side]}) then { | ||||||
| if (!(missionNamespace isNil format [QGVAR(Budget_%1), _side])) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| INFO_1("Overwriting previous budget for side [%1]",_side); | ||||||
| }; | ||||||
| if (!isNil {missionNamespace getVariable format [QGVAR(Objects_%1), _side]}) then { | ||||||
| if (!(missionNamespace isNil format [QGVAR(Objects_%1), _side])) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| INFO_1("Overwriting previous objects for side [%1]",_side); | ||||||
| }; | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |||||
| */ | ||||||
|
|
||||||
| // Exit if the action menu is already compiled for zeus | ||||||
| if (!isNil {missionNamespace getVariable [QGVAR(ZeusActions), nil]}) exitWith {}; | ||||||
| if (!(missionNamespace isNil QGVAR(ZeusActions))) exitWith {}; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| private _recurseFnc = { | ||||||
| params ["_actionsCfg"]; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,7 +36,7 @@ private _fnc_processNode = { | |||||
| private _conditionFullString = format ["%1 && {%2}", _parentConditionString, _condition call EFUNC(common,codeToString)]; | ||||||
|
|
||||||
| // don't add already added setting | ||||||
| if (isNil {missionNamespace getVariable _varName}) then { | ||||||
| if ((missionNamespace isNil _varName)) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| [_varName, "CHECKBOX", _titleFull, [_settingCategory, _rootActionTitle], false, 2, {}, true] call CBA_fnc_addSetting; | ||||||
| }; | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,15 +31,15 @@ GVAR(stateMachine) = [{call EFUNC(common,getLocalUnits)}, true] call CBA_statema | |||||
|
|
||||||
|
|
||||||
| [GVAR(stateMachine), "HealSelf", "Initial", { // Go back to initial state when done healing | ||||||
| !(call FUNC(isInjured)) && {isNil {_this getVariable QGVAR(currentTreatment)}} | ||||||
| !(call FUNC(isInjured)) && {(_this isNil QGVAR(currentTreatment))} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| }, { | ||||||
| #ifdef DEBUG_MODE_FULL | ||||||
| systemChat format ["%1 finished healing themself", _this]; | ||||||
| #endif | ||||||
| }, "Initial"] call CBA_statemachine_fnc_addTransition; | ||||||
|
|
||||||
| [GVAR(stateMachine), "HealSelf", "Injured", { // Stop treating when it's no more safe | ||||||
| !(call FUNC(isSafe)) && {isNil {_this getVariable QGVAR(currentTreatment)}} | ||||||
| !(call FUNC(isSafe)) && {(_this isNil QGVAR(currentTreatment))} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| }, { | ||||||
| #ifdef DEBUG_MODE_FULL | ||||||
| systemChat format ["%1 is no longer safe", _this]; | ||||||
|
|
@@ -48,15 +48,15 @@ GVAR(stateMachine) = [{call EFUNC(common,getLocalUnits)}, true] call CBA_statema | |||||
|
|
||||||
|
|
||||||
| [GVAR(stateMachine), "HealUnit", "Initial", { // Go back to initial state when done healing or it's no more safe to treat | ||||||
| !((call FUNC(wasRequested)) && FUNC(isSafe)) && {isNil {_this getVariable QGVAR(currentTreatment)}} | ||||||
| !((call FUNC(wasRequested)) && FUNC(isSafe)) && {(_this isNil QGVAR(currentTreatment))} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| }, { | ||||||
| #ifdef DEBUG_MODE_FULL | ||||||
| systemChat format ["%1 finished healing someone", _this]; | ||||||
| #endif | ||||||
| }, "Initial"] call CBA_statemachine_fnc_addTransition; | ||||||
|
|
||||||
| [GVAR(stateMachine), "HealUnit", "Injured", { // Treating yourself has priority | ||||||
| (call FUNC(isInjured)) && {isNil {_this getVariable QGVAR(currentTreatment)}} | ||||||
| (call FUNC(isInjured)) && {(_this isNil QGVAR(currentTreatment))} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| }, { | ||||||
| #ifdef DEBUG_MODE_FULL | ||||||
| systemChat format ["%1 was injured while healing someone", _this]; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -52,7 +52,7 @@ if (!(_rearmCargoConfig > 0 && _source getVariable [QGVAR(isSupplyVehicle), fals | |||||
| _source setVariable [QGVAR(isSupplyVehicle), true, true]; | ||||||
|
|
||||||
| // only add if menu does not already exist | ||||||
| if (isNil {_source getVariable QGVAR(initSupplyVehicle_jipID)}) then { | ||||||
| if ((_source isNil QGVAR(initSupplyVehicle_jipID))) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| private _jipID = [QGVAR(initSupplyVehicle), [_source]] call CBA_fnc_globalEventJIP; | ||||||
| [_jipID, _source] call CBA_fnc_removeGlobalEventJIP; | ||||||
| _source setVariable [QGVAR(initSupplyVehicle_jipID), _jipID]; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,7 +30,7 @@ if (isNil "_capacity") then { | |||||
| // Set capacity even if this isn't a fuel source to save on config lookup time in the event this function is used in a loop | ||||||
| _source setVariable [QGVAR(capacity), _capacity, true]; | ||||||
| // handle weird edge case when trying to run on "camera"/CfgNonAIVehicles which won't support setVariable and will inf-loop | ||||||
| if (isNil {_source getVariable QGVAR(capacity)}) exitWith { WARNING_1("trying to getCapacity from non-CfgVehicle %1",_this); }; | ||||||
| if ((_source isNil QGVAR(capacity))) exitWith { WARNING_1("trying to getCapacity from non-CfgVehicle %1",_this); }; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| [_source, _capacity] call FUNC(setFuel); | ||||||
| }; | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -44,7 +44,7 @@ if ( | |||||
|
|
||||||
| // We might be removing fuel from an object that in config doesn't have fuel, but was given fuel via this function prior | ||||||
| if (_fuelCargo == REFUEL_DISABLED_FUEL && {_fuelCargoConfig == REFUEL_DISABLED_FUEL}) exitWith { | ||||||
| if (isNil {_source getVariable QGVAR(currentFuelCargo)}) exitWith {}; | ||||||
| if ((_source isNil QGVAR(currentFuelCargo))) exitWith {}; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| _source setVariable [QGVAR(currentFuelCargo), nil, true]; | ||||||
| _source setVariable [QGVAR(capacity), REFUEL_DISABLED_FUEL, true]; | ||||||
|
|
@@ -75,7 +75,7 @@ if ( | |||||
| }; | ||||||
|
|
||||||
| // only add if menu doesn't already exist | ||||||
| if (_fuelCargoConfig != REFUEL_DISABLED_FUEL || {!isNil {_source getVariable QGVAR(initSource_jipID)}}) exitWith {}; | ||||||
| if (_fuelCargoConfig != REFUEL_DISABLED_FUEL || {!(_source isNil QGVAR(initSource_jipID))}) exitWith {}; | ||||||
|
|
||||||
| private _jipID = [QGVAR(initSource), [_source]] call CBA_fnc_globalEventJIP; | ||||||
| [_jipID, _source] call CBA_fnc_removeGlobalEventJIP; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -188,7 +188,7 @@ if (_loopAnim) then { | |||||
| if (_anim isEqualTo (_caller getVariable [QGVAR(repairCurrentAnimCaller), ""])) then { | ||||||
| [{ | ||||||
| params ["_caller", "_anim"]; | ||||||
| if !(isNil {_caller getVariable QGVAR(repairCurrentAnimCaller)}) then { | ||||||
| if !((_caller isNil QGVAR(repairCurrentAnimCaller))) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| TRACE_2("loop",_caller,_anim); | ||||||
| call EFUNC(common,doAnimation) | ||||||
| }; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -37,7 +37,7 @@ private _leaderVarName = _groupUnit getVariable [QGVAR(leaderVarName), ""]; | |||||
| if (_leaderVarName != "") exitWith { | ||||||
| // assign JIP unit as rallypoint leader | ||||||
| if (str _unit == _leaderVarName) then { | ||||||
| if (isNil {_unit getVariable "ACE_canMoveRallypoint"}) then { | ||||||
| if ((_unit isNil "ACE_canMoveRallypoint")) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| _unit setVariable ["ACE_canMoveRallypoint", true, true]; | ||||||
| }; | ||||||
| }; | ||||||
|
|
@@ -61,6 +61,6 @@ if (_leaderVarName == "") then { | |||||
| // prevent group from getting multiple leaders; use this to assign rallypoint moving ability on JIP | ||||||
| _groupUnit setVariable [QGVAR(leaderVarName), _leaderVarName]; | ||||||
|
|
||||||
| if (isNil {_unit getVariable "ACE_canMoveRallypoint"}) then { | ||||||
| if ((_unit isNil "ACE_canMoveRallypoint")) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| _unit setVariable ["ACE_canMoveRallypoint", true, true]; | ||||||
| }; | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -50,7 +50,7 @@ if (_weaponSelected) then { | |||||
| _safedWeaponMuzzles set [_muzzle, _firemode]; | ||||||
|
|
||||||
| // Lock muzzle | ||||||
| if (isNil {_unit getVariable QGVAR(actionID)}) then { | ||||||
| if ((_unit isNil QGVAR(actionID))) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| _unit setVariable [QGVAR(actionID), [ | ||||||
| _unit, "DefaultAction", { | ||||||
| params ["", "_unit"]; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,7 @@ if (!hasInterface) exitWith {}; | |||||
| } forEach keys (uiNamespace getVariable [QGVAR(seats), []]); | ||||||
|
|
||||||
| // Add interaction menu exception | ||||||
| ["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(sittingStatus)}}] call EFUNC(common,addCanInteractWithCondition); | ||||||
| ["isNotSitting", {((_this select 0) isNil QGVAR(sittingStatus))}] call EFUNC(common,addCanInteractWithCondition); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| // Handle interruptions | ||||||
| ["ace_unconscious", LINKFUNC(handleInterrupt)] call CBA_fnc_addEventHandler; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,7 +21,7 @@ params ["_seat", "_player", ["_seatPos", 0]]; | |||||
|
|
||||||
| // Sitting enabled, not occupied and standing up (or not on a big slope) | ||||||
| XGVAR(enable) && | ||||||
| {isNil {_player getVariable QGVAR(sittingStatus)}} && | ||||||
| {(_player isNil QGVAR(sittingStatus))} && | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| {round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}} && { | ||||||
| private _seatsClaimed = _seat getVariable [QGVAR(seatsClaimed), []]; | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,6 @@ | |||||
|
|
||||||
| params ["_player"]; | ||||||
|
|
||||||
| if (!isNil {_player getVariable QGVAR(sittingStatus)}) then { | ||||||
| if (!(_player isNil QGVAR(sittingStatus))) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| _player call FUNC(stand); | ||||||
| }; | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -83,7 +83,7 @@ private _seatDistOrig = (getPosASL _player) distance _seat; | |||||
| _args params ["_player", "_seat", "_seatPos", "_seatPosOrig", "_seatDistOrig"]; | ||||||
|
|
||||||
| // Remove PFH if not sitting any more | ||||||
| if (isNil {_player getVariable QGVAR(sittingStatus)}) exitWith { | ||||||
| if ((_player isNil QGVAR(sittingStatus))) exitWith { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| [_pfhId] call CBA_fnc_removePerFrameHandler; | ||||||
| TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(sittingStatus),false)]); | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,7 +28,7 @@ _trench setVariable [QGVAR(digging), true, true]; | |||||
| private _removeTime = missionNamespace getVariable [getText (configOf _trench >> QGVAR(removalDuration)), 12]; | ||||||
| private _removeTimeLeft = _removeTime * _actualProgress; | ||||||
|
|
||||||
| if (isNil {_trench getVariable QGVAR(placeData)}) then { | ||||||
| if ((_trench isNil QGVAR(placeData))) then { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| _trench setVariable [QGVAR(placeData), [getPosASL _trench, [vectorDir _trench, vectorUp _trench]], true]; | ||||||
| }; | ||||||
| private _placeData = _trench getVariable [QGVAR(placeData), [[], []]]; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -24,7 +24,7 @@ if (!GVAR(enabled)) exitWith { | |||||
| #endif | ||||||
| }; | ||||||
|
|
||||||
| if (!isNil {_vehicle getVariable QGVAR(handleDamage)}) exitWith {}; | ||||||
| if (!(_vehicle isNil QGVAR(handleDamage))) exitWith {}; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| _vehicle allowCrewInImmobile true; | ||||||
|
|
||||||
|
|
@@ -33,7 +33,7 @@ _vehicle allowCrewInImmobile true; | |||||
| [{ | ||||||
| params ["_vehicle"]; | ||||||
|
|
||||||
| if (!isNil {_vehicle getVariable QGVAR(handleDamage)}) exitWith {}; | ||||||
| if (!(_vehicle isNil QGVAR(handleDamage))) exitWith {}; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| TRACE_1("added eh",_vehicle); | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.