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

General - SQF Improvements #9698

Merged
merged 19 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldNa
private _gridCenter = [_x + 25, _y + 25];
private _gridHeight = round(getTerrainHeightASL _gridCenter);
private _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]);
private _gridSurfaceIsWater = if (surfaceIsWater _gridCenter) then {1} else {0};
private _gridSurfaceIsWater = parseNumber (surfaceIsWater _gridCenter);
"ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater];
GVAR(currentGrid) = GVAR(currentGrid) + 1;
if (GVAR(currentGrid) >= _gridCells) exitWith {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
private _weaponConfig = (configFile >> "CfgWeapons" >> _this);

private _barrelTwist = 0 max getNumber(_weaponConfig >> "ACE_barrelTwist");
private _twistDirection = [0, 1] select (_barrelTwist != 0);
private _twistDirection = parseNumber (_barrelTwist != 0);
if (isNumber (_weaponConfig >> "ACE_twistDirection")) then {
_twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection");
if !(_twistDirection in [-1, 0, 1]) then {
Expand Down
5 changes: 4 additions & 1 deletion addons/aircraft/functions/fnc_droneSetWaypoint.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ private _currentLoiterRadius = waypointLoiterRadius _waypoint;
private _currentLoiterType = waypointLoiterType _waypoint;

// Set pos to ATL
_pos set [2, if (_currentHeight >= 50) then { _currentHeight } else { 0 }];
_pos set [
2,
[0, _currentHeight] select (_currentHeight >= 50)
];

// [_group] call CBA_fnc_clearWaypoints;
_waypoint = _group addWaypoint [_pos, 0];
Expand Down
7 changes: 3 additions & 4 deletions addons/arsenal/functions/fnc_addStat.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,10 @@ private _tabToChange = [];
{
_x params ["_tab", "_tabSide"];

_tabToChange = if (_tabSide == "R") then {
_tabToChange = [
GVAR(statsListLeftPanel),
GVAR(statsListRightPanel)
} else {
GVAR(statsListLeftPanel)
};
] select (_tabSide == "R");

_stats = _tabToChange select _tab;

Expand Down
2 changes: 1 addition & 1 deletion addons/arsenal/functions/fnc_fillRightPanel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private _fnc_fillRightContainer = {
_ctrlPanel lnbSetText [[_lbAdd, 1], _displayName];
_ctrlPanel lnbSetData [[_lbAdd, 0], _className];
_ctrlPanel lnbSetPicture [[_lbAdd, 0], _picture];
_ctrlPanel lnbSetValue [[_lbAdd, 2], [0, 1] select _isUnique];
_ctrlPanel lnbSetValue [[_lbAdd, 2], parseNumber _isUnique];
_ctrlPanel lnbSetTooltip [[_lbAdd, 0], format ["%1\n%2", _displayName, _className]];
if ((toLower _className) in GVAR(favorites)) then {
_ctrlPanel lnbSetColor [[_lbAdd, 1], FAVORITES_COLOR];
Expand Down
2 changes: 1 addition & 1 deletion addons/arsenal/functions/fnc_onKeyDown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ if (!isNull _loadoutsDisplay) then {
// Right panel lnb + and - buttons
case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): {
if (GVAR(rightTabLnBFocus)) then {
[_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo);
[_display, parseNumber (_keyPressed != DIK_LEFT)] call FUNC(buttonCargo);
};
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ if (_allItems isEqualTo []) then { _allItems = [configName _config] };
|| {_illum && {([_xCfg >> "Flashlight" >> "irLight", "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1}};

private _text = switch (true) do { // shorthand roughly based on PEQ-15
case (_laser && _illum): { if (_isIR) then { "IR-DUAL" } else { "VIS-DUAL" } };
case (_laser): { if (_isIR) then { "IR-AIM" } else { "VIS-AIM" } }; // AIM
case (_illum): { if (_isIR) then { "IR-ILM" } else { "VIS-ILM" } }; // ILLUMIATION
case (_laser && _illum): { ["VIS-DUAL", "IR-DUAL"] select _isIR }; // DUAL
case (_laser): { ["VIS-AIM", "IR-AIM"] select _isIR }; // AIM
case (_illum): { ["VIS-ILM", "IR-ILM"] select _isIR }; // ILLUMIATION
default { "_" }; // there are some purely cosmetic attachements
};
_allModes pushBackUnique _text;
Expand Down
6 changes: 1 addition & 5 deletions addons/arsenal/functions/fnc_verifyLoadout.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ private _fnc_toConfigCase = {

// If item doesn't exist in config, "" is returned
// Just return unaltered item name in that case, so it can be documented as being unavailable
if (_name != "") then {
_name
} else {
_x
};
[_x, _name] select (_name != "");
} else {
_x
};
Expand Down
2 changes: 1 addition & 1 deletion addons/artillerytables/functions/fnc_rangeTableOpen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ GVAR(magModeData) = [];
{
_x params ["_xDisplayNameShort", "_xDisplayName", "_xInitSpeed", "_xAirFriction"];
if (_allSameCharge) then {
_ctrlChargeList lbAdd format ["%1", _xDisplayNameShort];
_ctrlChargeList lbAdd _xDisplayNameShort;
_ctrlChargeList lbSetTooltip [count GVAR(magModeData), format ["%1\n%2 m/s\n%3", _xDisplayName, _xInitSpeed toFixed 1, _xAirFriction]];
GVAR(magModeData) pushBack [_xInitSpeed, _xAirFriction];
} else {
Expand Down
6 changes: 3 additions & 3 deletions addons/atragmx/functions/fnc_update_result.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ if (GVAR(showWind2)) then {

_elevationAbs = Round(_elevationAbs * 100) / 100;
if (_elevationAbs > 0) then {
ctrlSetText [400, format["%1", abs(_elevationAbs)]];
ctrlSetText [400, str abs _elevationAbs];
} else {
if (_elevationAbs < 0) then {
ctrlSetText [400, format["%1D", abs(_elevationAbs)]];
Expand All @@ -100,7 +100,7 @@ if (_elevationAbs > 0) then {
};
_elevationRel = Round(_elevationRel * 100) / 100;
if (_elevationRel > 0) then {
ctrlSetText [401, format["%1", abs(_elevationRel)]];
ctrlSetText [401, str abs _elevationRel];
} else {
if (_elevationRel < 0) then {
ctrlSetText [401, format["%1D", abs(_elevationRel)]];
Expand All @@ -110,7 +110,7 @@ if (_elevationRel > 0) then {
};
_elevationCur = Round(_elevationCur * 100) / 100;
if (_elevationCur > 0) then {
ctrlSetText [402, format["%1", abs(_elevationCur)]];
ctrlSetText [402, str abs _elevationCur];
} else {
if (_elevationCur < 0) then {
ctrlSetText [402, format["%1D", abs(_elevationCur)]];
Expand Down
2 changes: 1 addition & 1 deletion addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
_object setVariable ["acre_sys_core_isDisabled", _set > 0, true];
};
if (["task_force_radio"] call FUNC(isModLoaded)) then {
_object setVariable ["tf_voiceVolume", [1, 0] select (_set > 0), true];
_object setVariable ["tf_voiceVolume", parseNumber (_set == 0), true];
};
}] call CBA_fnc_addEventHandler;

Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_disableUserInput.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ if (_state) then {
_keyPressedInfo set [1, ((_keyPressedInfo select 1) - 1) max 0];

if (_keyPressedInfo isEqualTo [false, 0]) then {
GVAR(keyboardInputMain) deleteAt _key,
GVAR(keyboardInputMain) deleteAt _key
};
}, _key, 0.5] call CBA_fnc_waitAndExecute;
}];
Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_receiveRequest.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (isLocalized _requestMessage) then {
_requestMessage = format [_requestMessage, [_caller, false, true] call FUNC(getName)];
};

hint format ["%1", _requestMessage]; // @todo ?
hint str _requestMessage; // @todo ?

if (!isNil QGVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT)) then {
terminate GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT);
Expand Down
2 changes: 1 addition & 1 deletion addons/dagr/functions/fnc_menuInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ GVAR(menuRun) = true;
};
case "options": {
(__dsp displayCtrl __Option0) ctrlSetText "Signal Delay";
(__dsp displayCtrl __Option1) ctrlSetText (if (GVAR(useDegrees)) then { "Direction: Deg" } else { "Direction: MIL" });
(__dsp displayCtrl __Option1) ctrlSetText (["Direction: MIL", "Direction: Deg"] select GVAR(useDegrees));
(__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QPATHTOF(UI\DAGR_Selection.paa);
if (GVAR(SEL)) then {
GVAR(vectorConnected) = false;
Expand Down
10 changes: 5 additions & 5 deletions addons/dagr/functions/fnc_outputData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ GVAR(outputPFH) = [{
private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString;

// Output
__gridControl ctrlSetText format ["%1", _dagrGrid];
__speedControl ctrlSetText format ["%1", _dagrSpeed];
__elevationControl ctrlSetText format ["%1", _dagrElevation];
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 �", _dagrHeading] });
__timeControl ctrlSetText format ["%1", _dagrTime];
__gridControl ctrlSetText _dagrGrid;
__speedControl ctrlSetText _dagrSpeed;
__elevationControl ctrlSetText _dagrElevation;
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { str _dagrHeading } else { format ["%1 �", _dagrHeading] });
__timeControl ctrlSetText _dagrTime;

}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler;
10 changes: 5 additions & 5 deletions addons/dagr/functions/fnc_outputVector.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ private _dagrDist = str GVAR(LAZDIST) + "m";
GVAR(vectorGrid) = _dagrGrid;

// OUTPUT
__gridControl ctrlSetText format ["%1", _dagrGrid];
__speedControl ctrlSetText format ["%1", _dagrDist];
__elevationControl ctrlSetText format ["%1", _dagrElevation];
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1°", _bearing] });
__timeControl ctrlSetText format ["%1", _dagrTime];
__gridControl ctrlSetText _dagrGrid;
__speedControl ctrlSetText _dagrDist;
__elevationControl ctrlSetText _dagrElevation;
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { str _bearing } else { format ["%1°", _bearing] });
__timeControl ctrlSetText _dagrTime;
10 changes: 5 additions & 5 deletions addons/dagr/functions/fnc_outputWP.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ GVAR(outputPFH) = [{
});

// Output
__gridControl ctrlSetText format ["%1", _dagrGrid];
__speedControl ctrlSetText format ["%1", _bearing];
__elevationControl ctrlSetText format ["%1", _dagrGrid2];
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1°", _dagrHeading] });
__timeControl ctrlSetText format ["%1", _dagrDistance];
__gridControl ctrlSetText _dagrGrid;
__speedControl ctrlSetText str _bearing;
__elevationControl ctrlSetText _dagrGrid2;
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { str _dagrHeading } else { format ["%1°", _dagrHeading] });
__timeControl ctrlSetText _dagrDistance;

}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler;
2 changes: 1 addition & 1 deletion addons/disarming/functions/fnc_showItemsInListbox.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ params ["_listBoxCtrl", "_itemsCountArray"];
};
};

_listBoxCtrl lbAdd format ["%1", _displayName];
_listBoxCtrl lbAdd _displayName;
_listBoxCtrl lbSetData [((lbSize _listBoxCtrl) - 1), _classname];
_listBoxCtrl lbSetPicture [((lbSize _listBoxCtrl) - 1), _picture];
_listBoxCtrl lbSetTextRight [((lbSize _listBoxCtrl) - 1), str _count];
Expand Down
2 changes: 1 addition & 1 deletion addons/fortify/functions/fnc_createObjectMarker.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private _direction = getDir _object;

// Marker name unique to this object
private _markerNameStr = format [QGVAR(marker_%1), hashValue _object];
private _channel = if (GVAR(markObjectsOnMap) == 2) then { 0 } else { 1 };
private _channel = parseNumber (GVAR(markObjectsOnMap) != 2);

private _marker = createMarkerLocal [_markerNameStr, _object, _channel, _unit];
TRACE_2("created",_marker,_channel);
Expand Down
2 changes: 1 addition & 1 deletion addons/hearing/functions/fnc_addEarPlugs.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _caliber = call {
if (_ammo isKindOf ["RocketBase", (configFile >> "CfgAmmo")]) exitWith { 200 };
if (_ammo isKindOf ["MissileBase", (configFile >> "CfgAmmo")]) exitWith { 600 };
if (_ammo isKindOf ["SubmunitionBase", (configFile >> "CfgAmmo")]) exitWith { 80 };
if (_caliber <= 0) then { 6.5 } else { _caliber };
[_caliber, 6.5] select (_caliber <= 0);
};
private _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) / 5;

Expand Down
6 changes: 4 additions & 2 deletions addons/hearing/functions/fnc_firedNear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ params ["_object", "_firer", "_distance", "_weapon", "", "", "_ammo"];
if (_weapon in ["Throw", "Put"]) exitWith {};
if (_distance > 50) exitWith {};

private _vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}) then {1} else {GVAR(playerVehAttenuation)};
private _vehAttenuation = [GVAR(playerVehAttenuation), 1] select (
(ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}
);
private _distance = 1 max _distance;

private _silencer = switch (_weapon) do {
Expand Down Expand Up @@ -78,7 +80,7 @@ if (isNil "_loudness") then {
if (_ammo isKindOf ["RocketBase", (configFile >> "CfgAmmo")]) exitWith { 200 };
if (_ammo isKindOf ["MissileBase", (configFile >> "CfgAmmo")]) exitWith { 600 };
if (_ammo isKindOf ["SubmunitionBase", (configFile >> "CfgAmmo")]) exitWith { 80 };
if (_caliber <= 0) then { 6.5 } else { _caliber };
[_caliber, 6.5] select (_caliber <= 0)
};

_loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) / 5;
Expand Down
9 changes: 4 additions & 5 deletions addons/hellfire/functions/fnc_getAttackProfileSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ private _configLaunchHeightClear = getNumber (_attackConfig >> QGVAR(launchHeigh
private _startingStage = if (_configLaunchHeightClear > 0) then {
STAGE_LAUNCH; // LOAL-HI / LO
} else {
if (_seekerTargetPos isEqualTo [0,0,0]) then {
STAGE_SEEK_CRUISE; // LOAL-DIR
} else {
STAGE_ATTACK_CRUISE // LOBL
};
[
STAGE_ATTACK_CRUISE,
STAGE_SEEK_CRUISE,
] select (_seekerTargetPos isEqualTo [0,0,0]);
};

// Set data in param array
Expand Down
2 changes: 1 addition & 1 deletion addons/huntir/functions/fnc_cam.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ GVAR(no_cams) sort true;
GVAR(cam) camCommit 0;

ctrlSetText [1, format["%1 m", round(GVAR(pos) select 2)]];
ctrlSetText [2, format["%1", GVAR(cur_cam) + 1]];
ctrlSetText [2, str (GVAR(cur_cam) + 1)];
private _cam_time = CBA_missionTime - (GVAR(huntIR) getVariable [QGVAR(startTime), CBA_missionTime]);
ctrlSetText [3, format["%1 s", round(_cam_time)]];
private _cam_pos = getPosVisual GVAR(huntIR);
Expand Down
2 changes: 1 addition & 1 deletion addons/interact_menu/functions/fnc_createAction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _position = if (_position isEqualType "") then {
} else {
if (_position isEqualType []) then {
// If the action is set to a array position, create the suitable code
compile format ["%1", _position];
compile str _position;
} else {
_position;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ _vehicles apply {
_name = format ["%1 (%2m)", _name, _distanceStr];
};
private _icon = [_x] call EFUNC(common,getVehicleIcon);
private _action = [format ["%1", _x], _name, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction);
private _action = [str _x, _name, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction);
[_action, [], _target]
}
2 changes: 1 addition & 1 deletion addons/interact_menu/functions/fnc_renderMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ if (_useListMenu) then {
_scaleX = _textSize * 0.17 * 1.1;
_scaleY = 0.17 * 0.30 * 4/3;
} else {
private _textSize = if (GVAR(textSize) > 2) then {1.3} else {1};
private _textSIze = [1, 1.3] select (GVAR(textSize) > 2);
_scaleX = _textSize * 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5);
_scaleY = _textSize * 0.17 * 4/3 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5);
};
Expand Down
2 changes: 1 addition & 1 deletion addons/interaction/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ GVAR(isOpeningDoor) = false;
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};

//Tap whichever shoulder is closest
private _shoulderNum = [0, 1] select (([cursorTarget, ACE_player] call BIS_fnc_relativeDirTo) > 180);
private _shoulderNum = parseNumber (([cursorTarget, ACE_player] call BIS_fnc_relativeDirTo) > 180);

// Statement
[ACE_player, cursorTarget, _shoulderNum] call FUNC(tapShoulder);
Expand Down
2 changes: 1 addition & 1 deletion addons/interaction/functions/fnc_addPassengersActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private _icon = "";

_actions pushBack [
[
format ["%1", _unit],
str _unit,
[_unit, true] call EFUNC(common,getName),
[_icon, "#FFFFFF"],
{
Expand Down
2 changes: 1 addition & 1 deletion addons/interaction/functions/fnc_openDoor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ GVAR(usedScrollWheel) = false;

// didn't use incremental opening. Just do animation normally.
if !(GVAR(usedScrollWheel)) then {
private _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5);
private _phase = parseNumber (_house animationPhase (_animations select 0) < 0.5);

{_house animate [_x, _phase]; false} count _animations;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/kestrel4500/functions/fnc_generateOutputData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ if (GVAR(referenceHeadingMenu) == 0) then {
};
case 1: { // Direction
if (!GVAR(MinAvgMax)) then {
_textCenterBig = format["%1", format["%1 %2", GVAR(Directions) select GVAR(Direction), round(_playerDir)]];
_textCenterBig = format["%1 %2", GVAR(Directions) select GVAR(Direction), round(_playerDir)];
} else {
_textCenterLine1Left = "Min";
_textCenterLine2Left = "Avg";
Expand Down
5 changes: 4 additions & 1 deletion addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ TRACE_2("Fence cutting started",_unit,_fence);
if (_unit != ACE_player) exitWith {};

// Get cut time based on if unit is a engineer
private _cutTime = if (_unit call EFUNC(common,isEngineer)) then {CUT_TIME_ENGINEER} else {CUT_TIME_DEFAULT};
private _cutTime = [
CUT_TIME_DEFAULT,
CUT_TIME_ENGINEER
] select (_unit call EFUNC(common,isEngineer));

if !(_unit call EFUNC(common,isSwimming)) then {
[_unit, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation);
Expand Down
10 changes: 5 additions & 5 deletions addons/medical/dev/watchVariable.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ GVAR(dev_watchVariableRunning) = true;
_return pushBack format ["<t color='#%1'>State: %2</t>", _color, _targetState];
private _hasStableVitals = ["N", "Y"] select ([_unit] call EFUNC(medical_status,hasStableVitals));
private _hasStableCondition = ["N", "Y"] select ([_unit] call EFUNC(medical_status,isInStableCondition));
private _unconcFlag = if IS_UNCONSCIOUS(_unit) then {"[<t color='#BBFFBB'>U</t>]"} else {""};
private _unconcFlag = ["", "[<t color='#BBFFBB'>U</t>]"] select IS_UNCONSCIOUS(_unit);
private _timeLeft = _unit getVariable [QEGVAR(medical_statemachine,cardiacArrestTimeLeft), -1];
private _cardiactArrestFlag = if IN_CRDC_ARRST(_unit) then {format ["[<t color='#BBBBFF'>CA</t> %1]", _timeLeft toFixed 1]} else {""};
_return pushBack format ["[StableVitals: %1] [StableCon: %2] %3 %4", _hasStableVitals, _hasStableCondition, _unconcFlag, _cardiactArrestFlag];
Expand All @@ -38,7 +38,7 @@ GVAR(dev_watchVariableRunning) = true;
private _woundBleeding = GET_WOUND_BLEEDING(_unit);
private _bloodLoss = GET_BLOOD_LOSS(_unit);
private _hemorrhage = GET_HEMORRHAGE(_unit);
private _isBleeding = if (IS_BLEEDING(_unit)) then {"<t color ='#FF9999'>Bleeding</t>"} else {""};
private _isBleeding = ["", "[<t color ='#FF9999'>Bleeding</t>]"] select IS_BLEEDING(_unit);
private _secondsToHeartstop = if (_bloodLoss != 0) then {format ["[<t color ='#FF9999'>Time Left:</t> %1 sec]", (((_bloodVolume - BLOOD_VOLUME_CLASS_4_HEMORRHAGE) max 0) / _bloodLoss) toFixed 0]} else {""};
_return pushBack format ["Blood: %1 [Hemorrhage: %2] %3", _bloodVolume toFixed 3, _hemorrhage, _isBleeding];
_return pushBack format [" - [W: %1 T: %2] %3", _woundBleeding toFixed 4, _bloodLoss toFixed 4, _secondsToHeartstop];
Expand All @@ -60,16 +60,16 @@ GVAR(dev_watchVariableRunning) = true;

// Damage:
private _damage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]];
private _limping = if (_unit getVariable [QEGVAR(medical,isLimping), false]) then {"[<t color ='#FFCC22'> Limping </t>]"} else {""};
private _limping = ["", "[<t color ='#FFCC22'> Limping </t>]"] select (_unit getVariable [QEGVAR(medical,isLimping), false]);
_return pushBack format ["BodyPartDamage: [H: %1] [B: %2]", (_damage select 0) toFixed 2, (_damage select 1) toFixed 2];
_return pushBack format ["[LA:%1] [RA: %2] [LL:%3] [RL: %4]", (_damage select 2) toFixed 2, (_damage select 3) toFixed 2, (_damage select 4) toFixed 2, (_damage select 5) toFixed 2];

_return pushBack format ["Hitpoints: [HHed:%1] [HBod: %2]", (_unit getHitPointDamage "HitHead") toFixed 2, (_unit getHitPointDamage "HitBody") toFixed 2];
_return pushBack format ["[HHnd:%1] [HLeg: %2] %3", (_unit getHitPointDamage "HitHands") toFixed 2, (_unit getHitPointDamage "HitLegs") toFixed 2, _limping];

private _fractures = GET_FRACTURES(_unit);
private _canSprint = if (isSprintAllowed _unit) then {""} else {"[<t color ='#FFCC22'>Sprint Blocked</t>]"};
private _forceWalk = if (isForcedWalk _unit) then {"[<t color ='#FF9922'>Forced Walking</t>]"} else {""};
private _canSprint = ["[<t color ='#FFCC22'>Sprint Blocked</t>]", ""] select (isSprintAllowed _unit);
private _forceWalk = ["", "[<t color ='#FF9922'>Forced Walking</t>]"] select (isForcedWalk _unit);
_return pushBack format ["Fractures: %1 %2%3", _fractures, _canSprint, _forceWalk];


Expand Down
Loading
Loading