Skip to content

Commit

Permalink
revert: coin issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Golbolco authored Dec 2, 2023
1 parent 74bf359 commit f22453c
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions Games/core/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -1660,24 +1660,6 @@ module.exports = class Game {
}
}

//Logic for distributing coins
const coinValue = function distributeCoins() {
// Checks for ranked game
if (this.ranked && player.won) {
return 1;
}
// Checks for competitive game
else if (this.competitive && player.won) {
return 5;
} else if (this.competitive && player.won === false) {
return -1;
}
// Unranked + Sandbox games receive 0 coins
else {
return 0;
}
};

await models.User.updateOne(
{ id: player.user.id },
{
Expand All @@ -1686,7 +1668,7 @@ module.exports = class Game {
$inc: {
rankedPoints: rankedPoints,
competitivePoints: competitivePoints,
coins: coinValue,
coins: this.ranked && player.won ? 1 : 0,
},
}
).exec();
Expand Down

0 comments on commit f22453c

Please sign in to comment.