Skip to content

Commit

Permalink
remove productVersion checks/ IS_LINUX macros
Browse files Browse the repository at this point in the history
  • Loading branch information
commy2 committed Jul 13, 2016
1 parent a4ea809 commit 33c3e77
Show file tree
Hide file tree
Showing 54 changed files with 56 additions and 315 deletions.
6 changes: 0 additions & 6 deletions addons/arrays/fnc_sortNestedArray.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ SCRIPT(sortNestedArray);

params [["_array", [], [[]]], ["_index", 0, [0]], ["_order", true, [false]]];

#ifndef LINUX_BUILD
private _helperArray = _array apply {
[_x select _index, _x]
};
#else
private _helperArray = [_array, {
[_x select _index, _x]
}] call CBA_fnc_filter;
#endif

_helperArray sort _order;

Expand Down
2 changes: 0 additions & 2 deletions addons/arrays/fnc_sortNestedArray_Linux.sqf

This file was deleted.

6 changes: 1 addition & 5 deletions addons/common/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ call COMPILE_FILE(init_perFrameHandler);
call COMPILE_FILE(init_delayLess);

// Due to activateAddons being overwritten by eachother (only the last executed command will be active), we apply this bandaid
#ifndef LINUX_BUILD
private _addons = ("true" configClasses (configFile >> "CfgPatches")) apply {configName _x};
#else
private _addons = ["true" configClasses (configFile >> "CfgPatches"), {configName _x}] call CBA_fnc_filter;
#endif
private _addons = ("true" configClasses (configFile >> "CfgPatches")) apply {configName _x};

activateAddons _addons;
GVAR(addons) = _addons;
Expand Down
2 changes: 0 additions & 2 deletions addons/common/XEH_preInit_Linux.sqf

This file was deleted.

6 changes: 1 addition & 5 deletions addons/common/fnc_dropMagazine.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ params [["_unit", objNull, [objNull]], ["_item", "", [""]], ["_ammo", -1, [0]]];

// random mag mode
if (_ammo < 0) then {
#ifndef LINUX_BUILD
_ammo = ((magazinesAmmoFull _unit select {_x select 0 == _item && {toLower (_x select 4) in ["uniform","vest","backpack"]}}) call BIS_fnc_selectRandom) param [1, "null"];
#else
_ammo = (([magazinesAmmoFull _unit, {_x select 0 == _item && {toLower (_x select 4) in ["uniform","vest","backpack"]}}] call BIS_fnc_conditionalSelect) call BIS_fnc_selectRandom) param [1, "null"];
#endif
_ammo = (selectRandom (magazinesAmmoFull _unit select {_x select 0 == _item && {toLower (_x select 4) in ["uniform","vest","backpack"]}})) param [1, "null"];
};

// no mag of this type in units inventory
Expand Down
2 changes: 0 additions & 2 deletions addons/common/fnc_dropMagazine_Linux.sqf

This file was deleted.

6 changes: 1 addition & 5 deletions addons/common/fnc_dropWeapon.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ SCRIPT(dropWeapon);

params [["_unit", objNull, [objNull]], ["_item", "", [""]]];

#ifndef LINUX_BUILD
private _weaponInfo = (weaponsItems _unit select {_x select 0 == _item}) param [0, []];
#else
private _weaponInfo = ([weaponsItems _unit, {_x select 0 == _item}] call BIS_fnc_conditionalSelect) param [0, []];
#endif
private _weaponInfo = (weaponsItems _unit select {_x select 0 == _item}) param [0, []];
private _return = [_unit, _item] call CBA_fnc_removeWeapon;

if (_return) then {
Expand Down
2 changes: 0 additions & 2 deletions addons/common/fnc_dropWeapon_Linux.sqf

This file was deleted.

6 changes: 1 addition & 5 deletions addons/common/fnc_getAlive.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,4 @@ if (_entities isEqualType grpNull) then {
_entities = units _entities;
};

#ifndef LINUX_BUILD
_entities select {alive _x} // return
#else
[_entities, {alive _x}] call BIS_fnc_conditionalSelect // return
#endif
_entities select {alive _x} // return
2 changes: 0 additions & 2 deletions addons/common/fnc_getAlive_Linux.sqf

This file was deleted.

12 changes: 1 addition & 11 deletions addons/common/fnc_getMagazineIndex.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,4 @@ private _displayName = getText (configFile >> "CfgMagazines" >> _magazine >> "di

if (_displayName isEqualTo "") exitWith {[]};

#ifndef LINUX_BUILD
magazinesDetail _unit select {_x find _displayName == 0} apply {_x = _x splitString "[:]"; _x select (count _x - 1)};
#else
[magazinesDetail _unit, {
if (_x find _displayName == 0) then {
_x = _x splitString "[:]";
_x = _x select (count _x - 1);
true
} else {false};
}] call BIS_fnc_conditionalSelect;
#endif
magazinesDetail _unit select {_x find _displayName == 0} apply {_x = _x splitString "[:]"; _x select (count _x - 1)};
2 changes: 0 additions & 2 deletions addons/common/fnc_getMagazineIndex_Linux.sqf

This file was deleted.

6 changes: 2 additions & 4 deletions addons/common/fnc_headDir.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,13 @@ if (_unit != call CBA_fnc_currentUnit) then {
private _diff = -_azimuth;

if !(_offset isEqualTo "") then {
#ifndef LINUX_BUILD
ADD(_diff,_unit getDir ([_offset] call CBA_fnc_getPos));
#else
ADD(_diff,[ARR_2(_unit,[_offset] call CBA_fnc_getPos)] call BIS_fnc_dirTo);
#endif
};

if (_diff < 0) then {
ADD(_diff,360);
};

if (_diff > 180) then {
SUB(_diff,360);
};
Expand Down
2 changes: 0 additions & 2 deletions addons/common/fnc_headDir_Linux.sqf

This file was deleted.

2 changes: 1 addition & 1 deletion addons/common/fnc_players.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ Author:
#include "script_component.hpp"
SCRIPT(players);

[allUnits + allDead, {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}}] call BIS_fnc_conditionalSelect
(allUnits + allDead) select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}}
32 changes: 9 additions & 23 deletions addons/common/fnc_removeMagazine.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,17 @@ if (_ammo < 0) then {
private _backpack = backpackContainer _unit;

// magazinesAmmoCargo bugged. returns nil for objNull.
#ifndef LINUX_BUILD
if (!isNull _uniform) then {
_uniformMagazines = magazinesAmmoCargo _uniform select {_x select 0 == _item};
};

if (!isNull _vest) then {
_vestMagazines = magazinesAmmoCargo _vest select {_x select 0 == _item};
};

if (!isNull _backpack) then {
_backpackMagazines = magazinesAmmoCargo _backpack select {_x select 0 == _item};
};
#else
if (!isNull _uniform) then {
_uniformMagazines = [magazinesAmmoCargo _uniform, {_x select 0 == _item}] call BIS_fnc_conditionalSelect;
};
if (!isNull _uniform) then {
_uniformMagazines = magazinesAmmoCargo _uniform select {_x select 0 == _item};
};

if (!isNull _vest) then {
_vestMagazines = [magazinesAmmoCargo _vest, {_x select 0 == _item}] call BIS_fnc_conditionalSelect;
};
if (!isNull _vest) then {
_vestMagazines = magazinesAmmoCargo _vest select {_x select 0 == _item};
};

if (!isNull _backpack) then {
_backpackMagazines = [magazinesAmmoCargo _backpack, {_x select 0 == _item}] call BIS_fnc_conditionalSelect;
};
#endif
if (!isNull _backpack) then {
_backpackMagazines = magazinesAmmoCargo _backpack select {_x select 0 == _item};
};

{
if (_x select 1 == _ammo) exitWith {
Expand Down
2 changes: 0 additions & 2 deletions addons/common/fnc_removeMagazine_Linux.sqf

This file was deleted.

6 changes: 1 addition & 5 deletions addons/common/fnc_turretPath.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,4 @@ params [["_unit", objNull, [objNull]]];

private _vehicle = vehicle _unit;

#ifndef LINUX_BUILD
(allTurrets [_vehicle, true] select {(_vehicle turretUnit _x) isEqualTo _unit}) param [0, []]
#else
([allTurrets [_vehicle, true], {(_vehicle turretUnit _x) isEqualTo _unit}] call BIS_fnc_conditionalSelect) param [0, []]
#endif
(allTurrets [_vehicle, true] select {(_vehicle turretUnit _x) isEqualTo _unit}) param [0, []]
6 changes: 1 addition & 5 deletions addons/common/fnc_turretPathWeapon.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,4 @@ params [["_vehicle", objNull, [objNull]], ["_weapon", "", [""]]];
private _turrets = allTurrets _vehicle;
_turrets pushBack [-1];

#ifndef LINUX_BUILD
(_turrets select {{_x == _weapon} count (_vehicle weaponsTurret _x) > 0}) param [0, []]
#else
([_turrets, {{_x == _weapon} count (_vehicle weaponsTurret _x) > 0}] call BIS_fnc_conditionalSelect) param [0, []]
#endif
(_turrets select {{_x == _weapon} count (_vehicle weaponsTurret _x) > 0}) param [0, []]
2 changes: 0 additions & 2 deletions addons/common/fnc_turretPathWeapon_Linux.sqf

This file was deleted.

2 changes: 0 additions & 2 deletions addons/common/fnc_turretPath_Linux.sqf

This file was deleted.

6 changes: 1 addition & 5 deletions addons/common/fnc_vehicleRole.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@ SCRIPT(vehicleRole);

params [["_unit", objNull, [objNull]]];

#ifndef LINUX_BUILD
fullCrew vehicle _unit select {(_x select 0) isEqualTo _unit} param [0, [nil, ""]] select 1
#else
([fullCrew vehicle _unit, {(_x select 0) isEqualTo _unit}] call BIS_fnc_conditionalSelect) param [0, [nil, ""]] select 1
#endif
fullCrew vehicle _unit select {(_x select 0) isEqualTo _unit} param [0, [nil, ""]] select 1
2 changes: 0 additions & 2 deletions addons/common/fnc_vehicleRole_Linux.sqf

This file was deleted.

13 changes: 2 additions & 11 deletions addons/events/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ if (!isNull (uiNamespace getVariable ["CBA_missionDisplay", displayNull])) then
};

PREP(keyHandler);
#ifndef LINUX_BUILD
PREP(keyHandlerDown);
#else
PREP(keyHandlerDown_Linux);
FUNC(keyHandlerDown) = FUNC(keyHandlerDown_Linux);
#endif
PREP(keyHandlerDown);
PREP(keyHandlerUp);

["keyDown", FUNC(keyHandlerDown)] call CBA_fnc_addDisplayHandler;
Expand All @@ -64,11 +59,7 @@ PREP(keyHandlerUp);
private _keyHandlers = [];
_keyHandlers resize 250;

#ifndef LINUX_BUILD
GVAR(keyDownStates) = _keyHandlers apply {[]};
#else
GVAR(keyDownStates) = [_keyHandlers, {[]}] call CBA_fnc_filter;
#endif
GVAR(keyDownStates) = _keyHandlers apply {[]};
GVAR(keyUpStates) = + GVAR(keyDownStates);

GVAR(keyHandlersDown) = call CBA_fnc_createNamespace;
Expand Down
2 changes: 0 additions & 2 deletions addons/events/XEH_preInit_Linux.sqf

This file was deleted.

7 changes: 1 addition & 6 deletions addons/events/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#include "script_component.hpp"

PREP(keyHandler);
#ifndef LINUX_BUILD
PREP(keyHandlerDown);
#else
PREP(keyHandlerDown_Linux);
FUNC(keyHandlerDown) = FUNC(keyHandlerDown_Linux);
#endif
PREP(keyHandlerDown);
PREP(keyHandlerUp);
2 changes: 0 additions & 2 deletions addons/events/XEH_preStart_Linux.sqf

This file was deleted.

7 changes: 2 additions & 5 deletions addons/events/fnc_addKeyHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,8 @@ _hash setVariable [_hashKey, [_key, _settings, _code, _allowHold, _holdDelay]];
private _keyHandlers = [GVAR(keyDownStates), GVAR(keyUpStates)] select (_type == "keyup");

private _hashKeys = _keyHandlers param [_key, []];
#ifndef LINUX_BUILD
_hashKeys pushBackUnique _hashKey; // pushBackUnique. Fixes using addKeyHander twice with the same keyHash/id executing the newly added action twice.
#else
_hashKeys pushBack _hashKey;
#endif
_hashKeys pushBackUnique _hashKey; // pushBackUnique. Fixes using addKeyHander twice with the same keyHash/id executing the newly added action twice.

_keyHandlers set [_key, _hashKeys];

_hashKey
2 changes: 0 additions & 2 deletions addons/events/fnc_addKeyHandler_Linux.sqf

This file was deleted.

2 changes: 0 additions & 2 deletions addons/events/fnc_addPlayerEventHandler_Linux.sqf

This file was deleted.

15 changes: 2 additions & 13 deletions addons/events/fnc_keyHandlerDown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ private _blockInput = false;
};

// check if either holding down a key is enabled or if the key wasn't already held down
#ifndef LINUX_BUILD
if (_execute && {_allowHold || {GVAR(keyUpActiveList) pushBackUnique _xUp != -1}}) then {
#else
if (_execute && {_allowHold || {!(_xUp in GVAR(keyUpActiveList))}}) then {
GVAR(keyUpActiveList) pushBack _xUp;
#endif
if (_execute && {_allowHold || {GVAR(keyUpActiveList) pushBackUnique _xUp != -1}}) then {
private _params = + _this;
_params pushBack + _keybindParams;
_params pushBack _x;
Expand All @@ -74,13 +69,7 @@ private _blockInput = false;

// Verify if the required modifier keys are present
if (_keybindSettings isEqualTo _inputSettings) then {
#ifndef LINUX_BUILD
GVAR(keyDownActiveList) pushBackUnique _x;
#else
if !(_x in GVAR(keyDownActiveList)) then {
GVAR(keyDownActiveList) pushBack _x;
};
#endif
GVAR(keyDownActiveList) pushBackUnique _x;
};
} forEach (GVAR(keyUpStates) param [_inputKey, []]);

Expand Down
2 changes: 0 additions & 2 deletions addons/events/fnc_keyHandlerDown_Linux.sqf

This file was deleted.

6 changes: 1 addition & 5 deletions addons/events/fnc_targetEvent.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ if !(_targets isEqualType []) then {
_targets = [_targets];
};

#ifndef LINUX_BUILD
private _remoteTargets = _targets select {!local GETOBJ(_x)};
#else
private _remoteTargets = [_targets, {!local GETOBJ(_x)}] call BIS_fnc_conditionalSelect;
#endif
private _remoteTargets = _targets select {!local GETOBJ(_x)};

// do local events if there is a local target
if (count _targets > count _remoteTargets) then {
Expand Down
2 changes: 0 additions & 2 deletions addons/events/fnc_targetEvent_Linux.sqf

This file was deleted.

9 changes: 2 additions & 7 deletions addons/hashes/fnc_hashCreate.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,8 @@ SCRIPT(hashCreate);
// -----------------------------------------------------------------------------
params [["_array", [], [[]]], "_defaultValue"];

#ifndef LINUX_BUILD
private _keys = _array apply {_x select 0};
private _values = _array apply {_x select 1};
#else
private _keys = [_array, {_x select 0}] call CBA_fnc_filter;
private _values = [_array, {_x select 1}] call CBA_fnc_filter;
#endif
private _keys = _array apply {_x select 0};
private _values = _array apply {_x select 1};

// Return.
[TYPE_HASH, _keys, _values, if (isNil "_defaultValue") then {nil} else {_defaultValue}];
2 changes: 0 additions & 2 deletions addons/hashes/fnc_hashCreate_Linux.sqf

This file was deleted.

4 changes: 2 additions & 2 deletions addons/help/fnc_setCreditsLine.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ if (CBA_DisableCredits) exitWith {};

// find addon with author
private _config = configFile >> "CfgPatches";
private _entry = ("
private _entry = selectRandom ("
isText (_x >> 'author') &&
{getText (_x >> 'author') != localize 'STR_A3_Bohemia_Interactive'} &&
{getText (_x >> 'author') != ''}
" configClasses _config) call (uiNamespace getVariable "BIS_fnc_selectRandom"); //bwc for 1.54 (Linux build)
" configClasses _config);

if (isNil "_entry") exitWith {};

Expand Down
18 changes: 3 additions & 15 deletions addons/jr/fnc_compatibleItems.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,14 @@ if (isNil "_compatibleItems") then {

if (isArray _cfgCompatibleItems) then {
{
#ifndef LINUX_BUILD
_compatibleItems pushBackUnique _x;
#else
if !(_x in _compatibleItems) then {_compatibleItems pushBack _x};
#endif
_compatibleItems pushBackUnique _x;
nil
} count getArray _cfgCompatibleItems;
} else {
if (isClass _cfgCompatibleItems) then {
{
if (getNumber _x > 0) then {
#ifndef LINUX_BUILD
_compatibleItems pushBackUnique configName _x;
#else
if !(configName _x in _compatibleItems) then {_compatibleItems pushBack configName _x};
#endif
_compatibleItems pushBackUnique configName _x;
};
nil
} count configProperties [_cfgCompatibleItems, "isNumber _x"];
Expand All @@ -80,9 +72,5 @@ if (isNil "_typefilter") then { //return
_typefilter = [-1, 101, 201, 301, 302] param [["", "muzzle", "optic", "pointer", "bipod"] find _typefilter, -1];
};

#ifndef LINUX_BUILD
_compatibleItems select {_typefilter == getNumber (configFile >> "CfgWeapons" >> _x >> "itemInfo" >> "type")}
#else
[_compatibleItems, {_typefilter == getNumber (configFile >> "CfgWeapons" >> _x >> "itemInfo" >> "type")}] call BIS_fnc_conditionalSelect
#endif
_compatibleItems select {_typefilter == getNumber (configFile >> "CfgWeapons" >> _x >> "itemInfo" >> "type")}
};
2 changes: 0 additions & 2 deletions addons/jr/fnc_compatibleItems_Linux.sqf

This file was deleted.

Loading

0 comments on commit 33c3e77

Please sign in to comment.