fix destroyed walls count too high
This commit is contained in:
parent
3d69f592f6
commit
6045de0c7d
2 changed files with 8 additions and 5 deletions
|
@ -104,5 +104,11 @@ internal sealed class Map(string name, bool[,] walls)
|
|||
return false;
|
||||
}
|
||||
|
||||
public void DestroyWallAt(PixelPosition pixel) => walls[pixel.X, pixel.Y] = false;
|
||||
public bool TryDestroyWallAt(PixelPosition pixel)
|
||||
{
|
||||
var result = walls[pixel.X, pixel.Y];
|
||||
if (result)
|
||||
walls[pixel.X, pixel.Y] = false;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue