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.
This commit is contained in:
FreezePhoenix
2024-03-15 17:18:51 -04:00
committed by GitHub
parent c935df7624
commit 72d3223988
+5 -5
View File
@@ -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) {