mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
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.
This commit is contained in:
parent
ae929ce2fd
commit
2a89531071
1 changed files with 1 additions and 1 deletions
|
@ -622,7 +622,7 @@ v3s16 rand_ortho_dir(PseudoRandom &random, bool diagonal_dirs)
|
||||||
dir.Z = random.next() % 3 - 1;
|
dir.Z = random.next() % 3 - 1;
|
||||||
dir.Y = 0;
|
dir.Y = 0;
|
||||||
dir.X = random.next() % 3 - 1;
|
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;
|
return dir;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue