From 9177f2d61dbaaf1892e809e80454e55c70d5909b Mon Sep 17 00:00:00 2001 From: Picoseconds Date: Sat, 1 Aug 2020 21:41:38 -0600 Subject: [PATCH] fix: make buying hats cost money --- src/moomoo/Game.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/moomoo/Game.ts b/src/moomoo/Game.ts index 475495b..2526cfe 100755 --- a/src/moomoo/Game.ts +++ b/src/moomoo/Game.ts @@ -322,7 +322,7 @@ export default class Game { let leaderboardUpdate: (string | number)[] = []; - for (let player of stableSort(this.state.players, (a, b) => { + for (let player of stableSort(this.state.players.filter(player => !player.dead), (a, b) => { if (a.points < b.points) return -1; if (a.points > b.points) return 1; return 0; @@ -959,6 +959,7 @@ export default class Game { this.kickClient(client, "Kicked for hacks"); } else { if (client.player.points >= (getHat(packet.data[1])?.price || 0)) { + client.player.points -= getHat(packet.data[1])?.price || 0; client.ownedHats.push(packet.data[1]); client.socket.send( packetFactory.serializePacket(