Skip to content

Commit

Permalink
fix: remove the player from spectator if it has to play the match
Browse files Browse the repository at this point in the history
  • Loading branch information
7mochi committed Sep 19, 2024
1 parent 099378c commit aed0d27
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/scripts/llhl.sma
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
enum (+=103) {
TASK_CVARCHECKER = 72958,
TASK_SHOWVENGINE,
TASK_CHEATCHECKER
TASK_CHEATCHECKER,
TASK_MM_START_MATCH
};

enum _:LLHLFile {
Expand Down Expand Up @@ -1195,6 +1196,9 @@ public MatchManagerStartMatch(id) {
if ((target = find_player("k", str_to_num(key)))) {
TrieIterGetString(iterator, value, charsmax(value), valueLength);
if (!equali(value, MM_NO_TEAM)) {
if (hl_get_user_spectator(target)) {
client_cmd(target, "spectate");
}
strtolower(value);
server_cmd("agforceteamup #%d %s", get_user_userid(target), value);
} else {
Expand All @@ -1205,16 +1209,20 @@ public MatchManagerStartMatch(id) {
}
}
CleanMenuData();
server_cmd("agstart");
client_print(id, print_chat, "%l", "LLHL_MM_MATCH_IS_STARTING");
TrieIterDestroy(iterator);
set_task(0.1, "TaskMatchManagerAgstart", TASK_MM_START_MATCH);
} else {
client_print(id, print_chat, "%l", "LLHL_MM_INVALID_PLAYER_COUNT");
DisplayMatchManagerMenu(id);
}
}
}

public TaskMatchManagerAgstart() {
server_cmd("agstart");
}

public MatchManagerAbortMatch(id) {
if (gGameState == GAME_IDLE) {
client_print(id, print_chat, "%l", "LLHL_MM_MATCH_IS_IDLE");
Expand Down

0 comments on commit aed0d27

Please sign in to comment.