mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-23 21:21:27 -05:00
Merge pull request #125 from FreezePhoenix/patch-14
Fix bug with Giveaways
This commit is contained in:
+9
-6
@@ -13170,12 +13170,12 @@ setInterval(function () {
|
|||||||
player.slots[slot].giveaway--;
|
player.slots[slot].giveaway--;
|
||||||
if (!player.slots[slot].giveaway) {
|
if (!player.slots[slot].giveaway) {
|
||||||
var list = [];
|
var list = [];
|
||||||
player.slots[slot].list.forEach(function (p) {
|
player.slots[slot].list.forEach(function (name) {
|
||||||
var p = get_player(p);
|
var player = get_player(name);
|
||||||
if (p && p.esize) {
|
if (player && player.esize) {
|
||||||
list.push(p);
|
list.push(player);
|
||||||
} else if (!mode.prevent_external) {
|
} else if (!mode.prevent_external) {
|
||||||
list.push({ name: p });
|
list.push({ name });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!list.length) {
|
if (!list.length) {
|
||||||
@@ -13204,7 +13204,10 @@ setInterval(function () {
|
|||||||
to: winner.name,
|
to: winner.name,
|
||||||
subject: "You've won a giveaway!",
|
subject: "You've won a giveaway!",
|
||||||
message:
|
message:
|
||||||
"Congratulations, you won " + player.name + "'s giveaway. Participants were: " + list.join(", "),
|
"Congratulations, you won " +
|
||||||
|
player.name +
|
||||||
|
"'s giveaway. Participants were: " +
|
||||||
|
list.map((e) => e.name).join(", "),
|
||||||
rid: randomStr(50),
|
rid: randomStr(50),
|
||||||
retries: 5,
|
retries: 5,
|
||||||
item: mitem,
|
item: mitem,
|
||||||
|
|||||||
Reference in New Issue
Block a user