From 12ac49938d5acc2ec07467a629196a748b15fd5a Mon Sep 17 00:00:00 2001 From: ericnerdo Date: Sat, 14 May 2016 21:01:17 +0200 Subject: [PATCH] Gates' extraordinal behavior with boxes fixed. --- cicaprojekt/Gate.java | 5 ++++- cicaprojekt/GateDrawer.java | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cicaprojekt/Gate.java b/cicaprojekt/Gate.java index 16203f8..7136aed 100644 --- a/cicaprojekt/Gate.java +++ b/cicaprojekt/Gate.java @@ -34,7 +34,10 @@ public class Gate extends Tile { @Override public boolean isSteppable() { - return open; + if(open) + return !hasBox(); + else + return open; } public boolean isOpen() { diff --git a/cicaprojekt/GateDrawer.java b/cicaprojekt/GateDrawer.java index f0db101..8ccb55d 100644 --- a/cicaprojekt/GateDrawer.java +++ b/cicaprojekt/GateDrawer.java @@ -15,7 +15,8 @@ public class GateDrawer extends AbstractDrawer { if(gate.isOpen()) { if(gate.hasBox()) changeImage("OpenGate_Box.png"); - changeImage("OpenGate.png"); + else + changeImage("OpenGate.png"); } else changeImage("Gate.png");