Skip to content

Commit 2a89531

Browse files
committedJan 26, 2017
Dungeongen: Fix selection of diagonal corridors
The do .. while loop is waiting for both dir.X and dir.Z to be non-zero, so should continue to loop if either dir.X or dir.Z are zero. The brackets present suggest this was intended to be OR not AND.
1 parent ae929ce commit 2a89531

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎src/dungeongen.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs)
622622
dir.Z = random.next() % 3 - 1;
623623
dir.Y = 0;
624624
dir.X = random.next() % 3 - 1;
625-
} while ((dir.X == 0 && dir.Z == 0) && trycount < 10);
625+
} while ((dir.X == 0 || dir.Z == 0) && trycount < 10);
626626

627627
return dir;
628628
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.