Skip to content

Commit

Permalink
changed the for-loop to make it less ugly
Browse files Browse the repository at this point in the history
  • Loading branch information
AdlerSalbei committed Aug 31, 2019
1 parent 501f0ec commit d235d08
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions addons/trenches/functions/fnc_placeTrench.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit d235d08

Please sign in to comment.