Skip to content

Commit 1335fcb

Browse files
Add minimum terrain climb height
1 parent 74f97e4 commit 1335fcb

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

addons/main/cba_settings.sqf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@
3737
false
3838
] call CBA_fnc_addSetting;
3939

40+
[QGVAR(minClimbTerrain),"SLIDER",
41+
[LSTRING(SettingDisplayName_minClimbTerrain),LSTRING(SettingDescription_minClimbTerrain)],
42+
[LSTRING(EnhancedMovementRework),LSTRING(SettingCategory_Core)],
43+
[0.3,3,0.3,1],
44+
true,
45+
{},
46+
false
47+
] call CBA_fnc_addSetting;
48+
4049
[QGVAR(assistHeight),"SLIDER",
4150
[LSTRING(SettingDisplayName_assistHeight),LSTRING(SettingDescription_assistHeight)],
4251
[LSTRING(EnhancedMovementRework),LSTRING(SettingCategory_Core)],

addons/main/functions/fnc_canClimb.sqf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,13 @@ if (_height > GVAR(maxClimbHeight)) then {
8888
DEBUG_R(_pos,_animPosASL);
8989
};
9090

91-
// Stop if no obstacle or too tall
92-
if (_height isEqualTo 0 || (_height > GVAR(maxClimbHeight) && isNull _assistant)) exitWith {[false,false,_height,_targetHeight,_animPosASL,_assistant]};
91+
// Stop if no obstacle, terrain too short, or obstacle too tall
92+
if (_height isEqualTo 0 ||
93+
(_height < GVAR(minClimbTerrain) && isNull _obstacle) ||
94+
(_height > GVAR(maxClimbHeight) && isNull _assistant)
95+
) exitWith {
96+
[false,false,_height,_targetHeight,_animPosASL,_assistant]
97+
};
9398

9499
// Weight check
95100
private _weight = _unit call FUNC(getWeight);

addons/main/stringtable.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@
9696
<Japanese>プレイヤーがとび降りることができるオブジェクトの高さを制限します。</Japanese>
9797
<German>Maximale Höhe, aus der ein Spieler fallen kann</German>
9898
</Key>
99+
<Key ID="STR_EMR_Main_SettingDisplayName_minClimbTerrain">
100+
<English>Minimum terrain climb height</English>
101+
</Key>
102+
<Key ID="STR_EMR_Main_SettingDescription_minClimbTerrain">
103+
<English>Relative height the terrain must be to be considered an obstacle (e.g. to prevent climbing on steep hills)</English>
104+
</Key>
99105
<Key ID="STR_EMR_Main_SettingDisplayName_assistHeight">
100106
<English>Assist height</English>
101107
<Japanese>アシストされる高さ</Japanese>

0 commit comments

Comments
 (0)