Skip to content

Commit

Permalink
game/heist: Fix payout of points from bet
Browse files Browse the repository at this point in the history
_ref: #1010
  • Loading branch information
sogehige committed Jun 7, 2018
1 parent 3815abc commit 6f81965
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/games/heist.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class Heist {

if (isSurvivor) {
// add points to user
let points = await global.systems.points.getPointsOf(user.username)
let points = parseInt((await global.db.engine.findOne(`${this.collection}.users`, { username: user.username })).points, 10)
await global.db.engine.insert('users.points', { username: user.username, points: parseInt(parseFloat(points * level.payoutMultiplier).toFixed(), 10) })
}
} else {
Expand All @@ -336,7 +336,7 @@ class Heist {

if (isSurvivor) {
// add points to user
let points = await global.systems.points.getPointsOf(user.username)
let points = parseInt((await global.db.engine.findOne(`${this.collection}.users`, { username: user.username })).points, 10)
await global.db.engine.insert('users.points', { username: user.username, points: parseInt(parseFloat(points * level.payoutMultiplier).toFixed(), 10) })
winners.push(user.username)
}
Expand Down

0 comments on commit 6f81965

Please sign in to comment.