Skip to content

Commit

Permalink
dont crash on mousedown
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Sep 26, 2023
1 parent 03396bb commit bd19f85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ const toggleFly = () => {
}
// #endregion
addEventListener('mousedown', (e) => {
if (!bot) return
// wheel click
// todo support ctrl+wheel (+nbt)
if (e.button === 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="wicg-file-system-access" />

declare const THREE: typeof import('three')
// todo
// todo make optional
declare const bot: import('mineflayer').Bot
declare const viewer: import('../prismarine-viewer/viewer/lib/viewer').Viewer | undefined
declare const worldView: import('../prismarine-viewer/viewer/lib/worldView').WorldView | undefined
Expand Down

0 comments on commit bd19f85

Please sign in to comment.