Preserve prepared match groups and English save continuation (by Codex)

This commit is contained in:
Codex committed 2026-10-18 11:40:04 +02:00
1 parent 481b525582
commit 978a014b87
4 files changed
+10 -11

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.24)
project(OpenBMH VERSION 0.2.0 LANGUAGES CXX C)
if(APPLE)
enable_language(OBJCXX)
enable_language(OBJC OBJCXX)
set(CMAKE_OBJCXX_STANDARD 20)
set(CMAKE_OBJCXX_STANDARD_REQUIRED ON)
endif()
+4 -6
View File
@@ -422,16 +422,14 @@ void restore_saved_turn_cursor(TurnDriver& driver, GameState& state, const Datab
if (!unsupported_continuation.empty()) return;
std::vector<int> active_leagues;
// DayCompetitions2's competition bits expand to group leagues in this original order;
// bit 2 owns both league 2 and 3. The stale descriptors after the active group count
// are intentionally ignored.
static constexpr int first_league[8] = {0, 1, 2, 4, 5, 6, 7, 8};
static constexpr int league_count[8] = {1, 1, 2, 1, 1, 1, 1, 1};
// Expand the selected edition's groups. Only the German third divisions
// share bit 2; the English divisions each have their own calendar group.
// Stale descriptors beyond the active group count are ignored.
for (int bit = 0; bit < 5; ++bit) {
if (!((competitions >> bit) & 1u)) continue;
const int first = bit, last = bit < 4 ? bit + 1 : 8;
for (int k = first; k < last; ++k)
for (int league = first_league[k]; league < first_league[k] + league_count[k]; ++league)
for (int league = kGroupLeague[k]; league < kGroupLeague[k] + kGroupLeagues[k]; ++league)
active_leagues.push_back(league);
}
if (active_leagues.size() > 6)
+3 -2
View File
@@ -92,8 +92,9 @@ MatchGroup group_json(const J &in) {
g.ended = uint32_t(ended);
g.kickoff_void_mask = uint32_t(mask);
if ((g.desc.size() != 0xc0 && g.desc.size() != 0xd0) || g.fixtures.size() % 2 || g.matches() > 32 ||
g.records.size() != size_t(g.matches()) * 18 || g.end_minute.size() != size_t(g.matches()) ||
g.spectators.size() != size_t(g.matches()))
(!g.records.empty() && g.records.size() != size_t(g.matches()) * 18) ||
(!g.end_minute.empty() && g.end_minute.size() != size_t(g.matches())) ||
(!g.spectators.empty() && g.spectators.size() != size_t(g.matches())))
fail("invalid match dimensions");
return g;
}
+2 -2
View File
@@ -126,8 +126,8 @@ class GtkLauncher final : public LauncherUI {
auto *dialog = gtk_file_chooser_dialog_new(
title.c_str(), GTK_WINDOW(window_), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, "Abbrechen",
GTK_RESPONSE_CANCEL, "Auswählen", GTK_RESPONSE_ACCEPT, nullptr);
if (!initial.empty())
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), path_to_utf8(initial).c_str());
const auto folder=initial.empty()?path_from_utf8(g_get_home_dir()):initial;
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),path_to_utf8(folder).c_str());
std::optional<std::filesystem::path> result;
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));