Skip to content
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

Remove unused local variable from CBA_fnc_isTurnedOut #1060

Merged
merged 2 commits into from
Feb 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions addons/common/fnc_isTurnedOut.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,40 +32,39 @@ SCRIPT(isTurnedOut);

params ["_unit"];

private _turn = false;
private _out = false;
private _vehicle = vehicle _unit;
private _cfg = configFile >> "CfgVehicles" >> (typeOf _vehicle);
private _cfg = configFile >> "CfgVehicles" >> typeOf _vehicle;

if (_vehicle != _unit) then {
if (driver _vehicle == _unit) then {
private _forceHideDriver = getNumber(_cfg >> "forceHideDriver");
_turn = (_forceHideDriver != 1);
_out = (_vehicle animationPhase "hatchDriver") > 0;
private _forceHideDriver = getNumber (_cfg >> "forceHideDriver");
_out = _vehicle animationPhase "hatchDriver" > 0;
} else {
private _assignedRole = assignedVehicleRole _unit;

if (_assignedRole select 0 == "Turret") then {
private _turretPath = _assignedRole select 1;
private _turret = [_vehicle, _turretPath] call CBA_fnc_getTurret;

private _canHideGunner = getNumber(_turret >> "canHideGunner");
private _forceHideGunner = getNumber(_turret >> "forceHideGunner");
_turn = (_canHideGunner == 1 && _forceHideGunner == 0);
private _canHideGunner = getNumber (_turret >> "canHideGunner");
private _forceHideGunner = getNumber (_turret >> "forceHideGunner");

private _hatchAnimation = getText(_turret >> "animationSourceHatch");
private _hatchAnimation = getText (_turret >> "animationSourceHatch");
_out = (_vehicle animationPhase _hatchAnimation) > 0;

} else {
if ((_assignedRole select 0) == "Cargo") then {
private _attenuateCargo = getArray(_cfg >> "soundAttenuationCargo");
if ((count _attenuateCargo) > 0) then {
private _index = (count _attenuateCargo)-1; // wait for command to get cargo index
if (_assignedRole select 0 == "Cargo") then {
private _attenuateCargo = getArray (_cfg >> "soundAttenuationCargo");

if (count _attenuateCargo > 0) then {
private _index = count _attenuateCargo - 1; // wait for command to get cargo index

if (_index > -1) then {
if(_index > (count _attenuateCargo)-1) then {
_index = (count _attenuateCargo)-1;
if (_index > count _attenuateCargo - 1) then {
_index = count _attenuateCargo - 1;
};
if((_attenuateCargo select _index) == 0) then {

if (_attenuateCargo select _index == 0) then {
_out = true;
};
};
Expand All @@ -76,5 +75,5 @@ if (_vehicle != _unit) then {
} else {
_out = true;
};
_out;

_out