Fixes a bug
This commit is contained in:
parent
0bc6dcdf02
commit
dec099ad32
|
@ -336,8 +336,9 @@ impl Map {
|
|||
self.collision_tiles[(i, j)] = tile;
|
||||
|
||||
// Refresh the current graphic tile and their neighbours
|
||||
for i in (i - 1) ..= (i + 1) {
|
||||
for j in (j - 1) ..= (j + 1) {
|
||||
use std::cmp::max;
|
||||
for i in max(i, 1) - 1 ..= (i + 1) {
|
||||
for j in max(j, 1) - 1 ..= (j + 1) {
|
||||
let new_tile = self.graphic_tile(i, j);
|
||||
if let Some(tile) = self.graphic_tiles.get_mut(i, j) {
|
||||
*tile = new_tile;
|
||||
|
|
Loading…
Reference in New Issue