[gnome-tetravex] Do not add empty tiles inversion to history.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tetravex] Do not add empty tiles inversion to history.
- Date: Sun, 22 Sep 2019 03:18:29 +0000 (UTC)
commit f801b18acb1de505a948eb1012d50c0a1103097f
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sun Sep 22 05:16:20 2019 +0200
Do not add empty tiles inversion to history.
src/puzzle.vala | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/src/puzzle.vala b/src/puzzle.vala
index a240c35..02bca0d 100644
--- a/src/puzzle.vala
+++ b/src/puzzle.vala
@@ -248,6 +248,9 @@ private class Puzzle : Object
Tile? t0 = board [x0, y0];
Tile? t1 = board [x1, y1];
+ if (t0 == null && t1 == null) // might happen when move_up and friends are called
+ return;
+
board [x0, y0] = t1;
board [x1, y1] = t0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]