diff --git a/cm_changelog.txt b/cm_changelog.txt index 8dce6ab160..8d4cc74325 100644 --- a/cm_changelog.txt +++ b/cm_changelog.txt @@ -75,8 +75,9 @@ This is usable for any OpenTTD servers == CHANGELOG == *** 12.1 (? Oct 2021) *** -- Hide new auto-terraforming mode for polyrail behind a setting for now as it is still quite bugged. -- Fix modifer keys selection in settings ui. +- Hid new auto-terraforming mode for polyrail behind a setting for now as it is still quite bugged. +- Fixed auto-terraforming messing remove mode in polyrail tool. +- Fixed modifer keys selection in settings ui. *** 12.0 (17 Oct 2021) *** - Automatically search servers when opening multiplayer window. diff --git a/src/citymania/cm_hotkeys.cpp b/src/citymania/cm_hotkeys.cpp index 4022950be1..e1d6b1c172 100644 --- a/src/citymania/cm_hotkeys.cpp +++ b/src/citymania/cm_hotkeys.cpp @@ -74,6 +74,10 @@ std::pair GetEPM() { _last_actions.size()); } +bool HasSeparateRemoveMod() { + return (_settings_client.gui.cm_fn_mod != _settings_client.gui.cm_remove_mod); +} + void UpdateModKeys(bool shift_pressed, bool ctrl_pressed, bool alt_pressed) { bool mod_pressed[(size_t)ModKey::END] = {false}; if (shift_pressed) mod_pressed[(size_t)ModKey::SHIFT] = true; @@ -97,10 +101,6 @@ void UpdateModKeys(bool shift_pressed, bool ctrl_pressed, bool alt_pressed) { } } -bool HasSeparateRemoveMod() { - return (_settings_client.gui.cm_fn_mod != _settings_client.gui.cm_remove_mod); -} - ToolRemoveMode RailToolbar_GetRemoveMode(int widget) { switch(widget) { case WID_RAT_BUILD_NS: diff --git a/src/citymania/cm_hotkeys.hpp b/src/citymania/cm_hotkeys.hpp index f85ec6256f..ef3081df5b 100644 --- a/src/citymania/cm_hotkeys.hpp +++ b/src/citymania/cm_hotkeys.hpp @@ -9,6 +9,7 @@ extern bool _fn_mod; extern bool _estimate_mod; extern bool _remove_mod; + enum class ToolRemoveMode : uint8 { NONE = 0, BUTTON = 1, diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 2f98c65e51..1434a99d11 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -515,7 +515,7 @@ static void HandleAutodirPlacement() if (citymania::_estimate_mod || !(_thd.place_mode & HT_POLY) || DoCommand(&cmd, DC_AUTO | DC_NO_WATER).GetErrorMessage() != STR_ERROR_ALREADY_BUILT || _rail_track_endtile == INVALID_TILE) { - if (_thd.cm_poly_terra) { + if (_thd.cm_poly_terra && !_remove_button_clicked) { if (!citymania::HandleAutodirTerraform(start_tile, end_tile, track, cmd)) return; } else { if (!DoCommandP(&cmd)) return; diff --git a/src/viewport.cpp b/src/viewport.cpp index 1bfbc16bc4..2556cc7229 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1181,7 +1181,7 @@ static void DrawTileSelection(const TileInfo *ti) case HT_LINE: { HighLightStyle type = GetPartOfAutoLine(ti->x, ti->y, _thd.selstart, _thd.selend, _thd.drawstyle & HT_DIR_MASK); if (type < HT_DIR_END) { - DrawAutorailSelection(ti, type, _thd.cm_poly_terra ? CM_SPR_PALETTE_ZONING_YELLOW : PAL_NONE); + DrawAutorailSelection(ti, type, _thd.cm_poly_terra && !_thd.make_square_red ? CM_SPR_PALETTE_ZONING_YELLOW : PAL_NONE); } else if (_thd.dir2 < HT_DIR_END) { type = GetPartOfAutoLine(ti->x, ti->y, _thd.selstart2, _thd.selend2, _thd.dir2); if (type < HT_DIR_END) DrawAutorailSelection(ti, type, PALETTE_SEL_TILE_BLUE);