fix: bug in RandomMapGenerator
This commit is contained in:
parent
60c18a4765
commit
936fda06ea
|
@ -155,7 +155,7 @@ export default class RandomMapGenerator {
|
||||||
}
|
}
|
||||||
if (!thisEntrance) {
|
if (!thisEntrance) {
|
||||||
if (!this.hasExit) {
|
if (!this.hasExit) {
|
||||||
// throw new Error("Wrong order in map template" + facing);
|
throw new Error("Wrong order in map template" + facing);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ export default class RandomMapGenerator {
|
||||||
this.rooms.push(room);
|
this.rooms.push(room);
|
||||||
this.roomPlaced += 1;
|
this.roomPlaced += 1;
|
||||||
if (this.hasExit && this.gen.random() <= 0.3) {
|
if (this.hasExit && this.gen.random() <= 0.3) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
for (let entrance of nextRoom.entrances) {
|
for (let entrance of nextRoom.entrances) {
|
||||||
if (entrance != thisEntrance) {
|
if (entrance != thisEntrance) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user