Lua API: Exclude color ranges with numeric names from the __dir output
In general they are not supposed to have numeric names, but several with numeric names exist for backwards compatibility.
This commit is contained in:
parent
d7eba7b950
commit
5bbca1a1c9
1 changed files with 4 additions and 0 deletions
|
@ -141,6 +141,10 @@ static int impl_colors_table_dir(lua_State* L)
|
|||
{
|
||||
std::vector<std::string> all_colours;
|
||||
for(const auto& [key, value] : game_config::team_rgb_range) {
|
||||
if(std::all_of(key.begin(), key.end(), [](char c) {return isdigit(c);})) {
|
||||
// These colors are deprecated, don't show them
|
||||
continue;
|
||||
}
|
||||
all_colours.push_back(key);
|
||||
}
|
||||
lua_push(L, all_colours);
|
||||
|
|
Loading…
Add table
Reference in a new issue