diff --git a/Cargo.lock b/Cargo.lock index 7fa4a77..f1c279c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -259,7 +259,7 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "ddnet-map-diff" -version = "0.1.0" +version = "0.1.1" dependencies = [ "clap", "color-eyre", diff --git a/Cargo.toml b/Cargo.toml index 60ab976..a01d795 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "ddnet-map-diff" authors = ["Edgar "] description = "A DDraceNetwork map diff tool." -version = "0.1.0" +version = "0.1.1" edition = "2021" license = "AGPL-3.0-only" repository = "https://github.com/edg-l/ddnet-map-diff" diff --git a/src/cli.rs b/src/cli.rs index 59feab3..cccb11a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -136,8 +136,10 @@ where for x in 0..width { for y in 0..height { - let index_old = tiles_old[(y, x)].id(); - let index_new = tiles_new[(y, x)].id(); + let old_tile = &tiles_old[(y, x)]; + let new_tile = &tiles_new[(y, x)]; + let index_old = old_tile.id(); + let index_new = new_tile.id(); if index_old == 0 && index_new != 0 { tiles_add[(y, x)].id = 1; @@ -148,6 +150,12 @@ where } else if index_old != index_new { tiles_mod[(y, x)].id = 1; modifications += 1; + } else { + // check if a tile state changed, like rotation + if old_tile.flags() != new_tile.flags() { + tiles_mod[(y, x)].id = 1; + modifications += 1; + } } } }