Skip to content

Commit

Permalink
Fixed a bug with not closing the window when changing the subserver (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisKvak1 authored Aug 20, 2024
1 parent 1d46161 commit d00c386
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/plugins/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,13 @@ function inject (bot, { hideErrors }) {
bot.currentWindow = null
bot.emit('windowClose', oldWindow)
})
bot._client.on('login', () => {
// close window when switch subserver
const oldWindow = bot.currentWindow
if (!oldWindow) return
bot.currentWindow = null
bot.emit('windowClose', oldWindow)
})
bot._client.on('set_slot', (packet) => {
// set slot
const window = packet.windowId === 0 ? bot.inventory : bot.currentWindow
Expand Down

0 comments on commit d00c386

Please sign in to comment.