fixed walk-in door bug

This commit is contained in:
musilto9 2020-03-04 23:18:43 +01:00
parent 25aa2271a1
commit c8f8d7dde3
2 changed files with 3 additions and 1 deletions

View File

@ -33,12 +33,13 @@ public class EventMoveToCell extends Cell {
public int getDirectionOut() { return directionOut; }
public void moveToMap() {
WindowOfFreeMove.getMap().getPerson().stopPerson();
WindowOfFreeMove.getMap().setIdExit(id);
WindowOfFreeMove.setMap(this.map);
WindowOfFreeMove.getMap().setIdExit(id);
WindowOfFreeMove.getMap().getPerson().stopPerson();
WindowOfFreeMove.paintMapOnWindow();
WindowOfFreeMove.repaintCanvas();
WindowOfFreeMove.setCanPersonMove(true);
}
@Override

View File

@ -80,6 +80,7 @@ public class Person extends Cell {
}
if (WindowOfFreeMove.getMap().isCellMoveTo(x, y)) {
set(x, y);
WindowOfFreeMove.setCanPersonMove(false);
if (!isMoving) {
WindowOfFreeMove.getMap().findEventByXY(x, y).moveToMap();
}