From d235d08f5a394a7d8d4c402c99f529e4bd20d575 Mon Sep 17 00:00:00 2001 From: Salbei Date: Sat, 31 Aug 2019 14:03:05 +0200 Subject: [PATCH] changed the for-loop to make it less ugly --- addons/trenches/functions/fnc_placeTrench.sqf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/trenches/functions/fnc_placeTrench.sqf b/addons/trenches/functions/fnc_placeTrench.sqf index 24f9338e9e5..53dc0d2ceb7 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -68,10 +68,9 @@ GVAR(digPFH) = [{ // Stick the trench to the ground _basePos set [2, getTerrainHeightASL _basePos]; private _minzoffset = 0; - private _ix = 0; - private _iy = 0; - for [{_ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { - for [{_iy = -_dy/2},{_iy <= _dy/2},{_iy = _iy + _dy/3}] do { + + for "_ix" from (-_dx/2) to (_dx/2) step (_dx/3) do { + for "_iy" from (-_dy/2) to (_dy/2) step (_dy/3) do { private _pos = _basePos vectorAdd (_v2 vectorMultiply _ix) vectorAdd (_v1 vectorMultiply _iy); _minzoffset = _minzoffset min ((getTerrainHeightASL _pos) - (_pos select 2));