mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
a4258f3587
* Viewports * Support mem-points * Update CfgVehicles.hpp * Add some docs * Cleanup Debugging * Update addons/viewports/dev/debugPoints.sqf Co-authored-by: Dystopian <sddex@ya.ru> * Update addons/viewports/dev/debugPoints.sqf Co-authored-by: Dystopian <sddex@ya.ru> * Update addons/viewports/functions/fnc_eachFrame.sqf Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> * configProperties / 3den macro * Update viewports-framework.md * Update viewports-framework.md * Add compats for rhs btrs * Update addons/viewports/dev/debugPoints.sqf Co-authored-by: Drofseh <Drofseh@users.noreply.github.com> Co-authored-by: Dystopian <sddex@ya.ru> Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> Co-authored-by: Drofseh <Drofseh@users.noreply.github.com>
47 lines
1.4 KiB
Plaintext
47 lines
1.4 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Dystopian, PabstMirror
|
|
* Adapted from quickmount's addFreeSeatsActions
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* ARRAY
|
|
*
|
|
* Example:
|
|
* [player] call ace_viewports_fnc_getSeatInfo
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_unit"];
|
|
|
|
private _vehicle = vehicle _unit;
|
|
if (_vehicle == _unit) exitWith { [] };
|
|
private _vehicleConfig = configOf _vehicle;
|
|
|
|
private _fullCrew = fullCrew [_vehicle, "", false];
|
|
(_fullCrew select (_fullCrew findIf {_unit == _x select 0})) params ["", "_role", "_cargoIndex", "_turretPath"];
|
|
|
|
private _compartment = switch (_role) do {
|
|
case "driver": {
|
|
(_vehicleConfig >> "driverCompartments") call BIS_fnc_getCfgData
|
|
};
|
|
case "cargo": {
|
|
// note: cargoNumber is different from the cargoIndex from fullCrew...
|
|
private _cargoNumber = fullCrew [_vehicle, "cargo", true] findIf {_unit == _x select 0};
|
|
private _cargoCompartments = getArray (_vehicleConfig >> "cargoCompartments");
|
|
private _cargoCompartmentsLast = count _cargoCompartments - 1;
|
|
_cargoCompartments select (_cargoNumber min _cargoCompartmentsLast)
|
|
};
|
|
default {
|
|
private _turretConfig = [_vehicleConfig, _turretPath] call CBA_fnc_getTurret;
|
|
(_turretConfig >> "gunnerCompartments") call BIS_fnc_getCfgData
|
|
};
|
|
};
|
|
|
|
if (!(_compartment isEqualType "")) then { _compartment = format ["Compartment%1",_compartment] };
|
|
|
|
[_role, _cargoIndex, _turretPath, _compartment]
|