mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 00:32:06 +00:00
Fix most of the clipping (minor stuff with doors left)
This commit is contained in:
@@ -56,30 +56,17 @@ public class Doors {
|
||||
}
|
||||
|
||||
public boolean handleDoor(Player player, int id, int x, int y, int z) {
|
||||
|
||||
Doors d = getDoor(id, x, y, z);
|
||||
|
||||
if (d == null) {
|
||||
if (DoubleDoors.getSingleton().handleDoor(player, id, x, y, z)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return DoubleDoors.getSingleton().handleDoor(player, id, x, y, z);
|
||||
}
|
||||
|
||||
//todo: improvment: if player manage to get to door then open the door.
|
||||
if(player.distanceToPoint(x, y) > 1) return false;
|
||||
|
||||
/**
|
||||
* Here we shall remove the clipping from the door
|
||||
* We can't add the clipping back when it is closed, because we apparently never update the d.open value....
|
||||
*/
|
||||
if(d != null) {
|
||||
if(d.open == 0) {
|
||||
Region.removeClipping(x, y, z);
|
||||
} else {
|
||||
//Region.addClipping(x, y, z, 0);
|
||||
}
|
||||
}
|
||||
//Remove clipping for old door (gets added back in placeObject)
|
||||
Region.removeClipping(x, y, z);
|
||||
|
||||
int xAdjustment = 0, yAdjustment = 0;
|
||||
if (d.type == 0) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.Scanner;
|
||||
import com.rebotted.GameEngine;
|
||||
import com.rebotted.game.objects.Objects;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.world.clip.Region;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -47,8 +48,8 @@ public class DoubleDoors {
|
||||
}
|
||||
|
||||
public boolean handleDoor(Player player, int id, int x, int y, int z) {
|
||||
DoubleDoors doorClicked = getDoor(id, x, y, z);
|
||||
|
||||
DoubleDoors doorClicked = getDoor(id, x, y, z);
|
||||
|
||||
if (doorClicked == null) {
|
||||
//GameEngine.objectHandler.placeObject(new Objects(-1, x, y, z, 0, 0, 0));
|
||||
return true;
|
||||
@@ -56,6 +57,9 @@ public class DoubleDoors {
|
||||
if (doorClicked.doorId > 12000) {
|
||||
return true; //nearly all of these are not opened
|
||||
}
|
||||
|
||||
Region.removeClipping(x, y, z);
|
||||
|
||||
if (doorClicked.open == 0) {
|
||||
if (doorClicked.originalFace == 0) {
|
||||
DoubleDoors lowerDoor = getDoor(id - 3, x, y -1, z);
|
||||
|
||||
Reference in New Issue
Block a user