-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove productVersion checks/ IS_LINUX macros
- Loading branch information
Showing
54 changed files
with
577 additions
and
836 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,26 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_getMagazineIndex | ||
Description: | ||
Finds out the magazine ID of all magazines of given type in the inventory of given unit. | ||
Parameters: | ||
_unit - Unit to check <OBJECT> | ||
_magazine - Magazines to check <OBJECT> | ||
Returns: | ||
Magazine IDs <ARRAY of STRINGS> | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(getMagazineIndex); | ||
|
||
params [["_unit", objNull, [objNull]], ["_magazine", "", [""]]]; | ||
|
||
private _displayName = getText (configFile >> "CfgMagazines" >> _magazine >> "displayName"); | ||
|
||
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 | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_getMagazineIndex | ||
Description: | ||
Finds out the magazine ID of all magazines of given type in the inventory of given unit. | ||
Parameters: | ||
_unit - Unit to check <OBJECT> | ||
_magazine - Magazines to check <OBJECT> | ||
Returns: | ||
Magazine IDs <ARRAY of STRINGS> | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(getMagazineIndex); | ||
|
||
params [["_unit", objNull, [objNull]], ["_magazine", "", [""]]]; | ||
|
||
private _displayName = getText (configFile >> "CfgMagazines" >> _magazine >> "displayName"); | ||
|
||
if (_displayName isEqualTo "") exitWith {[]}; | ||
|
||
magazinesDetail _unit select {_x find _displayName == 0} apply {_x = _x splitString "[:]"; _x select (count _x - 1)}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_players | ||
Description: | ||
Reports all (human) player objects. Does not include headless client entities. | ||
Unlike "BIS_fnc_listPlayers", this function will not report the game logics of headless clients. | ||
Parameters: | ||
None | ||
Returns: | ||
List of all player objects <ARRAY> | ||
Examples: | ||
(begin example) | ||
[] call CBA_fnc_players | ||
(end) | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(players); | ||
|
||
[allUnits + allDead, {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}}] call BIS_fnc_conditionalSelect | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_players | ||
Description: | ||
Reports all (human) player objects. Does not include headless client entities. | ||
Unlike "BIS_fnc_listPlayers", this function will not report the game logics of headless clients. | ||
Parameters: | ||
None | ||
Returns: | ||
List of all player objects <ARRAY> | ||
Examples: | ||
(begin example) | ||
[] call CBA_fnc_players | ||
(end) | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(players); | ||
|
||
(allUnits + allDead) select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_turretPath | ||
Description: | ||
Get a unit's turret path in the current vehicle. | ||
Reverse version of the turretUnit scripting command. | ||
Parameters: | ||
_unit - a soldier in a vehicle <OBJECT> | ||
Example: | ||
(begin example) | ||
_turretPath = player call CBA_fnc_turretPath | ||
(end) | ||
Returns: | ||
Soldiers turret path. [] when on foot, driver or in cargo <ARRAY> | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(turretPath); | ||
|
||
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 | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_turretPath | ||
Description: | ||
Get a unit's turret path in the current vehicle. | ||
Reverse version of the turretUnit scripting command. | ||
Parameters: | ||
_unit - a soldier in a vehicle <OBJECT> | ||
Example: | ||
(begin example) | ||
_turretPath = player call CBA_fnc_turretPath | ||
(end) | ||
Returns: | ||
Soldiers turret path. [] when on foot, driver or in cargo <ARRAY> | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(turretPath); | ||
|
||
params [["_unit", objNull, [objNull]]]; | ||
|
||
private _vehicle = vehicle _unit; | ||
|
||
(allTurrets [_vehicle, true] select {(_vehicle turretUnit _x) isEqualTo _unit}) param [0, []] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,32 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_turretPathWeapon | ||
Description: | ||
Get the turret path belonging to a weapon of given vehicle. | ||
Reverse version of the weaponsTurret scripting command. | ||
Parameters: | ||
_vehicle - a vehicle with turrets <OBJECT> | ||
_weapon - a weapon in the vehicles turret <STRING> | ||
Example: | ||
(begin example) | ||
_turretPath = [cameraOn, "HMG_127_mbt"] call CBA_fnc_turretPathWeapon | ||
(end) | ||
Returns: | ||
Weapons turret path. [-1] for driver weapon. [] when weapon not found. <ARRAY> | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(turretPathWeapon); | ||
|
||
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 | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_turretPathWeapon | ||
Description: | ||
Get the turret path belonging to a weapon of given vehicle. | ||
Reverse version of the weaponsTurret scripting command. | ||
Parameters: | ||
_vehicle - a vehicle with turrets <OBJECT> | ||
_weapon - a weapon in the vehicles turret <STRING> | ||
Example: | ||
(begin example) | ||
_turretPath = [cameraOn, "HMG_127_mbt"] call CBA_fnc_turretPathWeapon | ||
(end) | ||
Returns: | ||
Weapons turret path. [-1] for driver weapon. [] when weapon not found. <ARRAY> | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(turretPathWeapon); | ||
|
||
params [["_vehicle", objNull, [objNull]], ["_weapon", "", [""]]]; | ||
|
||
private _turrets = allTurrets _vehicle; | ||
_turrets pushBack [-1]; | ||
|
||
(_turrets select {{_x == _weapon} count (_vehicle weaponsTurret _x) > 0}) param [0, []] |
Oops, something went wrong.