diff --git a/src/sig/models/Staircase.java b/src/sig/models/Staircase.java index f99d625..ac7abbc 100644 --- a/src/sig/models/Staircase.java +++ b/src/sig/models/Staircase.java @@ -77,18 +77,17 @@ public class Staircase extends Mesh{ tris.add(b.block.triangles.get(7)); return tris; } - boolean checkCollision(float x,float y,float z) { + boolean checkCollision(float x,float y,float z,Staircase staircaseCheck) { for (int yy=0;yy=b.pos.y+3f) { valid=true; } else { + float diffX=Math.min(1,Math.max(0.3f,SigRenderer.vCamera.x+x-b.pos.x)); + float diffZ=Math.min(1,Math.max(0.3f,SigRenderer.vCamera.z+z-b.pos.z)); switch (b.getFacingDirection()) { case EAST: { - if (SigRenderer.vCamera.xb.pos.z+0.5f) { + if (SigRenderer.vCamera.z>b.pos.z+0.5f&&checkCollision(SigRenderer.vCamera.x+x, b.pos.y+(1-diffZ)+0.3f, SigRenderer.vCamera.z+z,this)) { valid=true; } }break; case SOUTH: { - if (SigRenderer.vCamera.zb.pos.x+0.5f) { + if (SigRenderer.vCamera.x>b.pos.x+0.5f&&checkCollision(SigRenderer.vCamera.x+x, b.pos.y+(1-diffX)+0.3f, SigRenderer.vCamera.z+z,this)) { valid=true; } }break;