From 0d82e2c08f643aa0ff1410248ac0e31bdf15a257 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 22 Feb 2016 16:07:39 +0100 Subject: Fix equality comparison --- src/ch/epfl/xblast/Cell.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ch') diff --git a/src/ch/epfl/xblast/Cell.java b/src/ch/epfl/xblast/Cell.java index c5fbad8..7673f4f 100644 --- a/src/ch/epfl/xblast/Cell.java +++ b/src/ch/epfl/xblast/Cell.java @@ -178,7 +178,8 @@ public final class Cell { */ @Override public boolean equals(Object that) { - if (!super.equals(that)) return false; + if (that == null) return false; + if (that == this) return true; if (!(that instanceof Cell)) return false; return (((Cell) that).x == this.x && ((Cell) that).y == this.y); } -- cgit v1.2.3