Skip to content

Commit

Permalink
Improve check for existing maps on the server
Browse files Browse the repository at this point in the history
  • Loading branch information
JensForstmann authored Oct 8, 2023
1 parent 1d928bc commit 73b1a8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/matchMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ export const loadMap = async (match: Match.Match, matchMap: IMatchMap) => {
await Match.say(match, `MAP WILL BE CHANGED TO ${matchMap.name} IN 15 SECONDS`);
match.log(`change map to ${matchMap.name} (in 15 seconds)`);
const response = await Match.execRcon(match, `maps ${matchMap.name}`);
if (!response.includes(matchMap.name)) {
const maps = response.trim().split("\n").map((map) => map.trim());
if (!maps.includes(matchMap.name)) {
match.log(`Map ${matchMap.name} could not be found on the server`);
await Match.say(match, `Map ${matchMap.name} could not be found on the server`);
return;
Expand Down

0 comments on commit 73b1a8a

Please sign in to comment.