Jump to content

doorHandler


ni562

Recommended Posts

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); 
}

 

Link to comment
Share on other sites

 

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));
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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