Skip to content

Commit

Permalink
fix: mapgen tunneling (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiedtl committed May 16, 2024
1 parent a48d036 commit c6597c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mapgen/tunneler.zig
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ pub const Ctx = struct {

// Update born_at
// XXX: I have no idea if this is correct or not
const p_length = roomie.parent.corridorLength();
switch (roomie.parent.direction) {
.North => roomie.born_at += fab.height,
.North => roomie.born_at = math.min(p_length, roomie.born_at + fab.height),
//.South => roomie.born_at -= fab.height,
.West => roomie.born_at += fab.width,
.West => roomie.born_at = math.min(p_length, roomie.born_at + fab.width),
//.East => roomie.born_at -= fab.width,
.South, .East => {},
else => unreachable,
Expand Down

0 comments on commit c6597c4

Please sign in to comment.