replace local keyword with private

This commit is contained in:
commy2 2015-11-17 17:43:07 +01:00
parent b6f9a2b776
commit a57d1bca75
24 changed files with 34 additions and 34 deletions

View File

@ -56,7 +56,7 @@ if (_state) then {
//Adds an animation changed eh
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
local _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
private _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
if (_animChangedEHID != -1) then {
TRACE_1("removing animChanged EH",_animChangedEHID);
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
@ -92,7 +92,7 @@ if (_state) then {
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
//remove AnimChanged EH
local _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
private _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
TRACE_1("removing animChanged EH",_animChangedEHID);
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
_unit setVariable [QGVAR(handcuffAnimEHID), -1];

View File

@ -48,7 +48,7 @@ if (_state) then {
if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then {
//Adds an animation changed eh
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
local _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
private _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
if (_animChangedEHID != -1) then {
TRACE_1("removing animChanged EH",_animChangedEHID);
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
@ -68,7 +68,7 @@ if (_state) then {
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
//remove AnimChanged EH
local _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
private _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
_unit setVariable [QGVAR(surrenderAnimEHID), -1];

View File

@ -13,7 +13,7 @@
//Handle the waitAndExec array:
while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= ACE_Time}} do {
local _entry = GVAR(waitAndExecArray) deleteAt 0;
private _entry = GVAR(waitAndExecArray) deleteAt 0;
(_entry select 2) call (_entry select 1);
};
@ -29,7 +29,7 @@
GVAR(nextFrameNo) = diag_frameno + 1;
//Handle the waitUntilAndExec array:
local _deleted = 0;
private _deleted = 0;
{
// if condition is satisifed call statement
if ((_x select 2) call (_x select 0)) then {

View File

@ -18,7 +18,7 @@
params ["_var", ["_depth", 0, [0]]];
local _pad = "";
private _pad = "";
for "_i" from 0 to _depth do {
_pad = _pad + toString [9];

View File

@ -17,7 +17,7 @@
params ["_unit"];
local _vehicle = vehicle _unit;
private _vehicle = vehicle _unit;
if (_unit == _vehicle) exitWith {[]};
scopeName "main";

View File

@ -14,11 +14,11 @@
params ["_unit"];
local _vehicle = vehicle _unit;
private _vehicle = vehicle _unit;
if (_unit == _vehicle) exitWith {false};
local _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
if (getNumber (_config >> "hideProxyInCombat") != 1) exitWith {false};
@ -26,10 +26,10 @@ if (_unit == driver _vehicle) exitWith {
getNumber (_config >> "forceHideDriver") == 0; // return
};
local _turret = [_unit] call FUNC(getTurretIndex);
private _turret = [_unit] call FUNC(getTurretIndex);
if (_turret isEqualTo []) exitWith {false};
local _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
getNumber (_turretConfig >> "forceHideGunner") == 0; // return

View File

@ -19,7 +19,7 @@
params ["_unit", "_muzzle", "_mode"];
local _index = 0;
private _index = 0;
while {
_index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}}

View File

@ -148,7 +148,7 @@ if (_backpack != "") then {
_unit addBackpack _backpack;
if (_clearBackpack) then {
local _backpackObject = unitBackpack _unit;
private _backpackObject = unitBackpack _unit;
clearMagazineCargoGlobal _backpackObject;
clearWeaponCargoGlobal _backpackObject;

View File

@ -14,13 +14,13 @@
BEGIN_COUNTER(timePFH);
local _lastTickTime = ACE_diagTime;
local _lastGameTime = ACE_gameTime;
private _lastTickTime = ACE_diagTime;
private _lastGameTime = ACE_gameTime;
ACE_gameTime = time;
ACE_diagTime = diag_tickTime;
local _delta = ACE_diagTime - _lastTickTime;
private _delta = ACE_diagTime - _lastTickTime;
if (ACE_gameTime <= _lastGameTime) then {
TRACE_1("paused",_delta);

View File

@ -95,7 +95,7 @@ GVAR(OldGlasses) = "#NULLSTRING";
}] call EFUNC(common,addEventHandler);
// check goggles
local _fnc_checkGoggles = {
private _fnc_checkGoggles = {
params ["_unit"];
if (GVAR(EffectsActive)) then {

View File

@ -28,7 +28,7 @@ _effects set [DIRT, true];
SETGLASSES(_unit,_effects);
if ([_unit] call FUNC(isGogglesVisible)) then {
local _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt");
private _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt");
if (_dirtImage != "") then {
GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false];

View File

@ -54,7 +54,7 @@ GVAR(DustHandler) = [{
if (ACE_diagTime >= GETDUSTT(DTIME) + 3) then {
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
local _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
private _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
if !(_unit getVariable ["ACE_EyesDamaged", false]) then {
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]];

View File

@ -27,7 +27,7 @@ _fnc_underCover = {
if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true};
// looking up and no roof over head
local _position = eyePos _unit;
private _position = eyePos _unit;
positionCameraToWorld [0, 0, 1] select 2 < (positionCameraToWorld [0, 0, 0] select 2) - 0.4 || {(lineIntersects [_position, _position vectorAdd [0, 0, 15], _unit])} // return
};

View File

@ -86,7 +86,7 @@ if (_safe) exitWith {};
// apply rotor wash effect
if (_rotorWash select 1 > 0) then {
local _scale = 0.7;
private _scale = 0.7;
if (_rotorWash select 1 > 0) then {
_scale = CLAMP(0.3 * (_rotorWash select 1),0.1,0.3);

View File

@ -73,7 +73,7 @@ SETDUST(DTIME,ACE_diagTime);
// apply dust effect if the amount of fired bullets is over the threshold
if (GETDUSTT(DAMOUNT) < 2) then {
local _bulletsRequired = 100;
private _bulletsRequired = 100;
if (isNumber (configFile >> _cloudType >> QGVAR(BulletCount))) then {
_bulletsRequired = getNumber (configFile >> _cloudType >> QGVAR(BulletCount));

View File

@ -17,7 +17,7 @@
params ["_glasses"];
local _config = configFile >> "CfgGlasses" >> _glasses;
private _config = configFile >> "CfgGlasses" >> _glasses;
if (!isClass _config) exitWith {false};

View File

@ -21,11 +21,11 @@
params ["_unit", ["_radius", 15]];
local _rotorWash = [false, 0];
private _rotorWash = [false, 0];
{
if (isEngineOn _x) then {
local _distance = _unit distance _x;
private _distance = _unit distance _x;
// convert distance to 0...1 range, where 0 is the maximum radius
_distance = 1 - _distance / _radius;

View File

@ -29,7 +29,7 @@ GVAR(isOpeningDoor) = false;
if (_unit == ACE_player) then {
addCamShake [4, 0.5, 5];
local _message = parseText format ([["%1 &gt;", localize LSTRING(YouWereTappedRight)], ["&lt; %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0));
private _message = parseText format ([["%1 &gt;", localize LSTRING(YouWereTappedRight)], ["&lt; %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0));
[_message] call FUNC(displayTextStructured);
};
}] call EFUNC(common,addEventHandler);

View File

@ -19,9 +19,9 @@
params ["_object"];
TRACE_1("params",_object);
local _typeOf = typeOf _object;
private _typeOf = typeOf _object;
local _returnValue = if (_typeOf != "") then {
private _returnValue = if (_typeOf != "") then {
//If the fence has configEntry we can check it directly
(1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence))));
} else {

View File

@ -47,7 +47,7 @@ if (_selection in R_LEG_SELECTIONS) exitwith {"leg_r"};*/
//Backup method to detect weird selections/hitpoints
if ((_selection == "?") || {!(_selection in GVAR(SELECTIONS))}) exitWith {
if (_hitPointIndex < 0) exitWith {_selection};
local _hitPoint = toLower configName ((configProperties [(configFile >> "CfgVehicles" >> (typeOf _unit) >> "HitPoints")]) select _hitPointIndex);
private _hitPoint = toLower configName ((configProperties [(configFile >> "CfgVehicles" >> (typeOf _unit) >> "HitPoints")]) select _hitPointIndex);
TRACE_4("Weird sel/hit", _unit, _selection, _hitPointIndex, _hitPoint);
if (_hitPoint in HEAD_HITPOINTS) exitWith {"head"};

View File

@ -19,7 +19,7 @@ GVAR(pendingReopen) = false;
["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey),
{
local _target = cursorTarget;
private _target = cursorTarget;
if (!((_target isKindOf "CAManBase") && {[ACE_player, _target] call FUNC(canOpenMenu)})) then {_target = ACE_player};
// Conditions: canInteract

View File

@ -20,7 +20,7 @@
params ["_selectionBloodLoss", "_damaged", "_display"];
// Handle the body image coloring
local _availableSelections = [50, 51, 52, 53, 54, 55];
private _availableSelections = [50, 51, 52, 53, 54, 55];
{
private ["_red", "_green", "_blue"];

View File

@ -25,7 +25,7 @@ if (_target isKindOf "StaticWeapon") exitWith {
// no check ammo action on destroyed static weapons
if (!alive _target) exitWith {false};
local _found = false;
private _found = false;
{
if (_x select 2) exitWith {

View File

@ -37,7 +37,7 @@ if (
};
if (currentWeapon _unit != "") then {
local _index = 0;
private _index = 0;
while {
_index < 100 && {currentWeaponMode _unit != _activeWeaponMode}