Fixed wall region indexing bug
[kaka/rust-sdl-test.git] / src / core / level / lvlgen.rs
index af6ab76..2e4d2f6 100644 (file)
@@ -227,7 +227,7 @@ impl LevelGenerator {
                let outline = r.outline(&grid.scale);
                let mut floats = outline.iter().map(|p| point!(p.x as f64, p.y as f64)).collect();
                self.smooth_wall(&mut floats, self.wall_smooth_radius as isize);
-               let wall = WallRegion::new(floats);
+               let wall = WallRegion::new(walls.len(), floats);
                walls.push(wall);
            }
        }