Skip to content

Commit

Permalink
checked the menu before checking the pointerlock element
Browse files Browse the repository at this point in the history
  • Loading branch information
honzi committed Dec 7, 2024
1 parent 1253761 commit 2c01423
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,11 @@ function core_handle_mouseup(event){
}

function core_handle_pointerlockchange(event){
if(document.pointerLockElement === null){
core_escape(true);

}else if(core_menu_open){
if(core_menu_open){
document.exitPointerLock();

}else if(document.pointerLockElement === null){
core_escape(true);
}
}

Expand Down

0 comments on commit 2c01423

Please sign in to comment.