Skip to content

Commit

Permalink
Dungeongen: Fix selection of diagonal corridors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
paramat committed Jan 26, 2017
1 parent ae929ce commit 2a89531
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dungeongen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs)
dir.Z = random.next() % 3 - 1;
dir.Y = 0;
dir.X = random.next() % 3 - 1;
} while ((dir.X == 0 && dir.Z == 0) && trycount < 10);
} while ((dir.X == 0 || dir.Z == 0) && trycount < 10);

return dir;
} else {
Expand Down

0 comments on commit 2a89531

Please sign in to comment.