mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Refactor private ARRAY to private keyword (#5598)
* Everything * Fixed missing ; * Fix missing ; and double private * Fixed cannot isNull on number * Turn _temparture back to isNil * Fix error from merge
This commit is contained in:
committed by
PabstMirror
parent
22c8ef1e8a
commit
81e02a7336
@ -22,9 +22,7 @@ if (inputAction "nextWeapon" > 0) exitWith {};
|
||||
|
||||
params ["_unit", "_weapon", "_muzzle"];
|
||||
|
||||
private ["_safedWeapons", "_picture"];
|
||||
|
||||
_safedWeapons = _unit getVariable [QGVAR(safedWeapons), []];
|
||||
private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []];
|
||||
|
||||
if (_weapon in _safedWeapons) exitWith {
|
||||
_this call FUNC(unlockSafety);
|
||||
@ -69,5 +67,5 @@ if (_muzzle isEqualType "") then {
|
||||
[_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound);
|
||||
|
||||
// show info box
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture);
|
||||
|
@ -18,16 +18,14 @@
|
||||
|
||||
params ["_unit", "_weapon"];
|
||||
|
||||
private ["_sound", "_position"];
|
||||
|
||||
_sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound");
|
||||
private _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound");
|
||||
|
||||
if (_sound isEqualTo []) exitWith {
|
||||
playSound "ACE_Sound_Click";
|
||||
};
|
||||
|
||||
// get position where to play the sound (position of the weapon)
|
||||
_position = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand"));
|
||||
private _position = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand"));
|
||||
|
||||
_sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]];
|
||||
|
||||
|
@ -19,9 +19,7 @@
|
||||
|
||||
params ["_unit", "_weapon", "_muzzle"];
|
||||
|
||||
private ["_safedWeapons", "_picture"];
|
||||
|
||||
_safedWeapons = _unit getVariable [QGVAR(safedWeapons), []];
|
||||
private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []];
|
||||
_safedWeapons deleteAt (_safedWeapons find _weapon);
|
||||
|
||||
_unit setVariable [QGVAR(safedWeapons), _safedWeapons];
|
||||
@ -36,10 +34,8 @@ _unit selectWeapon _muzzle;
|
||||
|
||||
if (inputAction "nextWeapon" > 0) then {
|
||||
// switch to the last mode to roll over to first after the default nextWeapon action
|
||||
private ["_modes", "_mode", "_index"];
|
||||
|
||||
// get weapon modes
|
||||
_modes = [];
|
||||
private _modes = [];
|
||||
{
|
||||
if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then {
|
||||
_modes pushBack _x;
|
||||
@ -51,10 +47,10 @@ if (inputAction "nextWeapon" > 0) then {
|
||||
} count getArray (configFile >> "CfgWeapons" >> _weapon >> "modes");
|
||||
|
||||
// select last mode
|
||||
_mode = _modes select (count _modes - 1);
|
||||
private _mode = _modes select (count _modes - 1);
|
||||
|
||||
// switch to last mode
|
||||
_index = 0;
|
||||
private _index = 0;
|
||||
while {
|
||||
_index < 299 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}}
|
||||
} do {
|
||||
@ -70,5 +66,5 @@ if (inputAction "nextWeapon" > 0) then {
|
||||
[true] call FUNC(setSafeModeVisual);
|
||||
|
||||
// show info box
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture);
|
||||
|
Reference in New Issue
Block a user