howdy folks!
k... i have a var: $level
this is incremented and decreased as a function walks through a tree....
i'm going through and optimising the code, removing all the nasties... and have come across something strange.
this is what i'm using to move the level up or down..
$level = $level-1+((int)!$direction*2);
$direction is either 1 or 0... as a result, the $level var should go up and down as required...
when in the loop, the answer is ALWAYS 0... but when i do something like :
$direction = 1;
$level = 0;
$level = $level-1+((int)!$direction*2);
that always works as expected..., regardless of what number level is...
here's some stuff around where the line isnt working
if ( isset($tree[(int)!$direction][$x+1]) ) {
$level = $level-1+((int)!$direction*2);
$direction = (int)!$direction;
}
i wouldnt think that would affect it tho... level is used nowhere else...