check hand for item before dropping (#83)

prevents spam promise rejection in console when pressing q with empty hand
This commit is contained in:
u9g 2021-03-14 07:23:24 -04:00 committed by GitHub
commit 0d0cda3e17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -237,7 +237,7 @@ async function connect (options) {
reloadHotbarSelected(bot, numPressed - 1)
}
if (e.code === 'KeyQ') {
bot.tossStack(bot.heldItem)
if (bot.heldItem) bot.tossStack(bot.heldItem)
}
}, false)