mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-14 18:39:27 -05:00
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:
+5
-5
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user