diff options
Diffstat (limited to 'dungeon')
| -rw-r--r-- | dungeon/src/pos.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/dungeon/src/pos.rs b/dungeon/src/pos.rs index ac2d6d0..f6c5eb4 100644 --- a/dungeon/src/pos.rs +++ b/dungeon/src/pos.rs @@ -194,9 +194,8 @@ impl Pos { /// ``` #[must_use] pub const fn idx(self) -> usize { - let (x, y) = self.xy(); - let idx = x + y * MAP_SIZE; - idx as usize + let (x, y) = (self.x() as usize, self.y() as usize); + x + y * MAP_SIZE_USIZE } /// Converse an index into a possible x and y position |