From 8225593756e73306c12f2a55e0f8c398d72e784e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 4 Dec 2018 23:07:56 +0100 Subject: [PATCH] racing:: not available in bounded words (disabled in menu, changing geometry disables racing --- racing.cpp | 22 +++++++++++++--------- system.cpp | 4 ++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/racing.cpp b/racing.cpp index eb1c7aa2..354d00bb 100644 --- a/racing.cpp +++ b/racing.cpp @@ -693,15 +693,19 @@ struct race_configurer { dialog::add_action([this] () { new_track = "OFFICIAL"; }); dialog::addItem("play a random track", 'r'); dialog::add_action([this] () { new_track = random_track_name(); }); - - dialog::addItem(XLAT("select the track and start!"), 's'); - dialog::add_action([this] () { - if(race_ghosts[{new_track, modecode()}].empty()) - read_ghosts(new_track, modecode()); - else - println(hlog, "known ghosts: ", isize(race_ghosts[{new_track, modecode()}])); - pushScreen([this] () { track_chooser(new_track); }); - }); + + if(bounded) + dialog::addInfo("Racing available only in unbounded worlds.", 0xFF0000); + else { + dialog::addItem(XLAT("select the track and start!"), 's'); + dialog::add_action([this] () { + if(race_ghosts[{new_track, modecode()}].empty()) + read_ghosts(new_track, modecode()); + else + println(hlog, "known ghosts: ", isize(race_ghosts[{new_track, modecode()}])); + pushScreen([this] () { track_chooser(new_track); }); + }); + } dialog::addBreak(100); diff --git a/system.cpp b/system.cpp index e96df85d..b2d1e481 100644 --- a/system.cpp +++ b/system.cpp @@ -1159,6 +1159,9 @@ void set_geometry(eGeometry target) { geometry = target; if(chaosmode && bounded) chaosmode = false; + #if CAP_RACING + if(bounded) racing::on = false; + #endif if(euclid6) variation = eVariation::bitruncated; if(IRREGULAR) variation = eVariation::bitruncated; if(GOLDBERG && gp::param == gp::loc(1,1) && S3 == 3) { @@ -1253,6 +1256,7 @@ void switch_game_mode(char switchWhat) { inv::on = false; chaosmode = false; princess::challenge = false; + if(bounded) set_geometry(gNormal); break; #endif