Skip to content
Snippets Groups Projects
Commit 9abcbf53 authored by pumapaul's avatar pumapaul
Browse files

Fix bug where enemy could attack on the other side of the map

parent cab33c3b
No related branches found
No related tags found
No related merge requests found
......@@ -188,7 +188,8 @@ impl GameState {
}
fn check_is_neighbor(a: Point, b: Point) -> bool {
return GameState::check_neighbor_uint(a.0, b.0) || GameState::check_neighbor_uint(a.1, b.1);
GameState::check_neighbor_uint(a.0, b.0) && a.1 == b.1
|| GameState::check_neighbor_uint(a.1, b.1) && a.0 == b.0
}
fn check_neighbor_uint(a: usize, b: usize) -> bool {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment