Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning text to inform on map being played in an unsupported mode #1241

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions mods/ctf/ctf_modebase/match.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ function ctf_modebase.start_match_after_vote()
ctf_teams.allocate_teams(ctf_map.current_map.teams)

ctf_modebase.current_mode_matches_played = ctf_modebase.current_mode_matches_played + 1

local current_map = ctf_map.current_map
local current_mode = ctf_modebase.current_mode

if table.indexof(current_map.game_modes, current_mode) == -1 then
local concat = "The current mode is not in the list of modes supported by the current map."
local cmd_text = string.format("/ctf_next -f [mode:technical modename] %s", current_map.dirname)
minetest.chat_send_all(minetest.colorize(
"red", string.format("%s\nSupported mode(s): %s. To switch to a mode set for the map, do %s",
concat, table.concat(current_map.game_modes, ", "), cmd_text)))
end
end)
end

Expand Down
Loading