Skip to content

Commit

Permalink
Fixed deleted scoreboards not being removed from ScoreBoard.positions (
Browse files Browse the repository at this point in the history
  • Loading branch information
Ynfuien committed Feb 26, 2024
1 parent aa99daa commit 643023d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/plugins/scoreboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ function inject (bot) {
if (packet.action === 1) {
bot.emit('scoreboardDeleted', scoreboards[packet.name])
delete scoreboards[packet.name]

for (const position in ScoreBoard.positions) {
const scoreboard = ScoreBoard.positions[position]
if (scoreboard.name === packet.name) {
delete ScoreBoard.positions[position]
break
}
}
}

if (packet.action === 2) {
Expand Down

0 comments on commit 643023d

Please sign in to comment.