Skip to content

Commit

Permalink
Update currentVersion to v4.2.2 and fix condition for checking linked…
Browse files Browse the repository at this point in the history
… Discord ID
  • Loading branch information
IgnisAlienus committed Mar 12, 2024
1 parent 28b709b commit 74f6ac4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions squad-server/plugins/my-squad-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import fs from 'fs';

import BasePlugin from './base-plugin.js';

const currentVersion = 'v4.2.1';
const currentVersion = 'v4.2.2';

export default class MySquadStats extends BasePlugin {
static get description() {
Expand Down Expand Up @@ -175,7 +175,11 @@ export default class MySquadStats extends BasePlugin {
}
}

if (currentVersion.localeCompare(latestVersion, undefined, { numeric: true }) < 0) {
if (
currentVersion.localeCompare(latestVersion, undefined, {
numeric: true,
}) < 0
) {
this.verbose(1, `A new version of ${repo} is available. Updating...`);

const updatedCodeUrl = `https://raw.githubusercontent.com/${currentOwner}/${repo}/${latestVersion}/squad-server/plugins/my-squad-stats.js`;
Expand Down Expand Up @@ -619,7 +623,7 @@ export default class MySquadStats extends BasePlugin {
}
const player = response.data[0];
// If discordID is already linked, return error
if (player.discordID !== null) {
if (player.discordID !== 'Unknown') {
await this.server.rcon.warn(
info.player.steamID,
`Your account is already linked.\nContact an MySquadStats.com if this is wrong.`
Expand Down

0 comments on commit 74f6ac4

Please sign in to comment.