Jump to content

doorHandler


Recommended Posts

Posted
So far my script is working great but theres a litle bug i can't seem to fix....
 
When the door to the STAIR_AREA is already open, it will click a door that is near the stairs but not at all in my path.. :( 
 
Is there a way to check if the nearest door is already open and skip this bit ? 
 

if (doorHandler.handleNextObstacle(STAIR_AREA)) {
walker.walk(STAIR_AREA.getRandomPosition(), true); 
}

 

Posted

 

So far my script is working great but theres a litle bug i can't seem to fix....
 
When the door to the STAIR_AREA is already open, it will click a door that is near the stairs but not at all in my path.. sad.png
 
Is there a way to check if the nearest door is already open and skip this bit ? 
 

if (doorHandler.handleNextObstacle(STAIR_AREA)) {
walker.walk(STAIR_AREA.getRandomPosition(), true); 
}

 

if(getMap().canReach(STAIR_AREA.getRandomPosition())){

    walker.walk(STAIR_AREA.getRandomPosition(), true);
} else{

    doorHandler.handleNextObstacle(STAIR_AREA));
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...