diff --git a/addons/arsenal/functions/fnc_fillRightPanel.sqf b/addons/arsenal/functions/fnc_fillRightPanel.sqf index 99194b065e..c62ea3cab8 100644 --- a/addons/arsenal/functions/fnc_fillRightPanel.sqf +++ b/addons/arsenal/functions/fnc_fillRightPanel.sqf @@ -86,7 +86,7 @@ private _compatibleMagazines = [[[], []], [[], []], [[], []]]; private _magArray = [_magazineGroups, _x] call CBA_fnc_hashGet; {((_compatibleMagazines select _index) select _subIndex) pushBackUnique _x} forEach _magArray; } else { - ((_compatibleMagazines select _index) select _subIndex) pushBackUnique _x + ((_compatibleMagazines select _index) select _subIndex) pushBackUnique (configName (configFile >> "CfgMagazines" >> _x)) } } foreach ([getArray (_weaponConfig >> _x >> "magazines"), getArray (_weaponConfig >> "magazines")] select (_x == "this")); } foreach getArray (_weaponConfig >> "muzzles"); diff --git a/addons/atragmx/functions/fnc_update_gun.sqf b/addons/atragmx/functions/fnc_update_gun.sqf index ff7de54a1c..5e081b47ee 100644 --- a/addons/atragmx/functions/fnc_update_gun.sqf +++ b/addons/atragmx/functions/fnc_update_gun.sqf @@ -24,7 +24,7 @@ if (GVAR(currentUnit) != 2) then { if (GVAR(currentUnit) != 2) then { ctrlSetText [110, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; } else { - ctrlSetText [110, Str(Round(GVAR(workingMemory) select 12))]; + ctrlSetText [110, Str(Round((GVAR(workingMemory) select 12) * 10) / 10)]; }; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { ctrlSetText [120, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; diff --git a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf index 7d29252b28..4beaf53e0d 100644 --- a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf +++ b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf @@ -25,7 +25,7 @@ if (GVAR(currentUnit) != 2) then { if (GVAR(currentUnit) != 2) then { ctrlSetText [120010, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; } else { - ctrlSetText [120010, Str(Round(GVAR(workingMemory) select 12))]; + ctrlSetText [120010, Str(Round((GVAR(workingMemory) select 12) * 10) / 10)]; }; if (GVAR(currentUnit) != 2) then { ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) / 10 / 2.54 * 1000) / 1000)]; diff --git a/addons/common/functions/fnc_fixPosition.sqf b/addons/common/functions/fnc_fixPosition.sqf index 3eaf7665cd..700d47dc19 100644 --- a/addons/common/functions/fnc_fixPosition.sqf +++ b/addons/common/functions/fnc_fixPosition.sqf @@ -22,11 +22,14 @@ if (!local _this) exitWith {}; private _hasGravity = simulationEnabled _this && {getText (configFile >> "CfgVehicles" >> typeOf _this >> "simulation") != "house"}; if (!_hasGravity) then { - private _posAbove = (getPosATL _this) select 2; - TRACE_2("house",_this,_posAbove); - if (_posAbove > 0.1) then { - private _newPosATL = (getPosATL _this) vectorDiff [0, 0, _posAbove]; - _this setPosATL _newPosATL; + private _positionASL = getPosASL _this; + // find height of top surface under object + private _surfaces = lineIntersectsSurfaces [_positionASL, ATLToASL [_positionASL select 0, _positionASL select 1, -1], _this]; + if (_surfaces isEqualTo []) exitWith {}; + private _surfaceHeight = _surfaces select 0 select 0 select 2; + TRACE_2("house",_this,_surfaceHeight); + if (_positionASL select 2 > _surfaceHeight + 0.1) then { + _this setPosASL [_positionASL select 0, _positionASL select 1, _surfaceHeight]; }; }; diff --git a/docs/wiki/development/coding-guidelines.md b/docs/wiki/development/coding-guidelines.md index 53363ba312..3e83c631cf 100644 --- a/docs/wiki/development/coding-guidelines.md +++ b/docs/wiki/development/coding-guidelines.md @@ -178,6 +178,10 @@ Every function should have a header of the following format as the start of thei * Arguments: * 0: The first argument * 1: The second argument + * 2: Multiple input types + * 3: Optional input (default: true) + * 4: Optional input with multiple types (default: {true}) + * 5: Not mandatory input (default: nil) * * Return Value: * The return value