minor fix for door glitch (#123)

* running locally env - null password given

* open door from distance fix, needs improvment
This commit is contained in:
LeonBeilis
2019-10-27 21:14:53 +02:00
committed by Daniel Ginovker
parent dd206ece70
commit abcb1133d8
2 changed files with 494 additions and 492 deletions
@@ -7,7 +7,7 @@ import java.util.Scanner;
import redone.Server;
import redone.game.objects.Objects;
import redone.game.players.Player;
public class Doors {
@@ -53,17 +53,21 @@ public class Doors {
}
return null;
}
public boolean handleDoor(int id, int x, int y, int z) {
public boolean handleDoor(int id, int x, int y, int z, Player player) {
Doors d = getDoor(id, x, y, z);
if (d == null) {
if (DoubleDoors.getSingleton().handleDoor(id, x, y, z)) {
return true;
}
return false;
}
//todo: improvment: if player manage to get to door then open the door.
if(player.distanceToPoint(x, y) > 1) return false;
int xAdjustment = 0, yAdjustment = 0;
if (d.type == 0) {
if (d.open == 0) {