Skip to content

Commit 89c2a73

Browse files
committed
fix random match group in classic mode
1 parent db41b2e commit 89c2a73

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/components/quickplay/ServerFinder.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import xMarkImg from "@img/xmark.webp";
22
import {
33
baseGamemodes,
4+
classicGameModeSearchAll,
45
classicMaps,
56
getDefaultMatchGroups,
67
getSpecialEventDesc,
@@ -325,7 +326,7 @@ export default function ServerFinder({ hash }: { hash: string }) {
325326
if (mapMatchGroup !== expectedGamemode) {
326327
return false;
327328
}
328-
} else if (expectedGamemode !== "any") {
329+
} else if (expectedGamemode !== "any" && expectedGamemode !== "random" && expectedGamemode !== "pvp") {
329330
const mapGamemode = mapToGamemode[server.map];
330331
if (mapGamemode) {
331332
if (mapGamemode !== expectedGamemode) {
@@ -368,7 +369,11 @@ export default function ServerFinder({ hash }: { hash: string }) {
368369

369370
const filterServerForGamemodes = (server: GameServer, tags: Set<string>) => {
370371
const currentMatchGroup = quickplayStore.matchGroup;
371-
if (currentMatchGroup === "pvp") {
372+
if (quickplayStore.classicMode && currentMatchGroup === "random") {
373+
return classicGameModeSearchAll.some((gm) =>
374+
filterServerForGamemode(gm, server, tags),
375+
);
376+
} else if (currentMatchGroup === "pvp") {
372377
return gamemodeList.some((gm) =>
373378
filterServerForGamemode(gm, server, tags),
374379
);

src/ssg/quickplayStaticData.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export const classicGameModes = {
153153
}
154154

155155
export const classicGameModeSet = new Set(Object.keys(classicGameModes));
156+
export const classicGameModeSearchAll = Object.keys(classicGameModes).filter(code => code !== "random");
156157

157158
export const classicMaps = new Set([
158159
"cp_dustbowl",

0 commit comments

Comments
 (0)