From cb99f84ded60c90e1460a2a6529fc9d0eca13dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bokros=20B=C3=A1lint?= Date: Fri, 13 May 2016 20:54:17 +0200 Subject: [PATCH] Boxes now cannot be put on walls -- and other places, where they don't belong fixes #8 --- cicaprojekt/Player.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cicaprojekt/Player.java b/cicaprojekt/Player.java index 2dad2d4..5a5342f 100644 --- a/cicaprojekt/Player.java +++ b/cicaprojekt/Player.java @@ -22,8 +22,11 @@ public class Player extends PlayerBase { } public void boxDrop() { - currentTile.getAdjacentTile(facingDirection).putABox(boxLifted); - boxLifted = null; + Tile target = currentTile.getAdjacentTile(facingDirection); + if(target.isSteppable()) { + target.putABox(boxLifted); + boxLifted = null; + } } @Override