From 72d322398897206a3f90d1d5e082f0665038573b Mon Sep 17 00:00:00 2001 From: FreezePhoenix <24441367+FreezePhoenix@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:18:51 -0400 Subject: [PATCH] Fix another bug with Giveaways If a player was not on the server when the giveaway ended, or their inventory was full, then the server would push `{ name: undefined }` into the list of players that could win the giveaway. This would send the item into the abyss, as it would error while the server would try to mail the item, preventing it from being recovered. --- node/server.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node/server.js b/node/server.js index 5c29c05..9c71ff5 100644 --- a/node/server.js +++ b/node/server.js @@ -13168,12 +13168,12 @@ setInterval(function () { player.slots[slot].giveaway--; if (!player.slots[slot].giveaway) { var list = []; - player.slots[slot].list.forEach(function (p) { - var p = get_player(p); - if (p && p.esize) { - list.push(p); + player.slots[slot].list.forEach(function (name) { + var player = get_player(name); + if (player && player.esize) { + list.push(player); } else if (!mode.prevent_external) { - list.push({ name: p }); + list.push({ name }); } }); if (!list.length) {