Skip to content

Commit

Permalink
mapgen: Prevent digging outside map domain
Browse files Browse the repository at this point in the history
  • Loading branch information
rsaarelm committed Aug 31, 2018
1 parent 68ba2b9 commit 206c314
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions world/src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ impl Map {
}
}

if !self.contains(pos) {
// You can place unwalkable stuff outside the map area, but you need to make sure
// it stays unwalkable so make it undiggable.
c.can_dig = false;
}

self.insert(pos, c);
}
}
Expand Down

0 comments on commit 206c314

Please sign in to comment.