Refactor clamping height

This commit is contained in:
Timi007 2022-06-23 20:06:52 +02:00
parent 78bfefb932
commit 1322155502
No known key found for this signature in database
GPG Key ID: AFC60E0DA93308DA

View File

@ -24,12 +24,7 @@ if (GVAR(isPlacing) isNotEqualTo PLACE_WAITING) exitWith {
// Move object height 10cm per scroll
GVAR(objectHeight) = GVAR(objectHeight) + (_scrollAmount * 0.1);
if (GVAR(objectHeight) < MIN_HEIGHT) then {
GVAR(objectHeight) = MIN_HEIGHT;
};
if (GVAR(objectHeight) > MAX_HEIGHT) then {
GVAR(objectHeight) = MAX_HEIGHT;
};
// Clamp height between MIN_HEIGHT and MAX_HEIGHT
GVAR(objectHeight) = (MIN_HEIGHT max (GVAR(objectHeight) min MAX_HEIGHT));
true