Fix polyrail tool terra highlight getting stuck after closing tool

This commit is contained in:
dP
2021-10-31 03:57:18 +03:00
parent cdb3a9af1e
commit 20dd0bb9bb
3 changed files with 6 additions and 5 deletions

View File

@@ -1458,14 +1458,14 @@ HighLightStyle UpdateTileSelection(HighLightStyle new_drawstyle) {
}
}
new_drawstyle = HT_RECT;
} else if (_thd.cm_new_poly_terra) {
} else if ((_thd.place_mode & HT_POLY) && _thd.cm_new_poly_terra) {
_thd.cm_new = ObjectHighlight::make_polyrail(TileVirtXY(_thd.selstart.x, _thd.selstart.y),
TileVirtXY(_thd.selend.x, _thd.selend.y),
_thd.cm_poly_dir,
TileVirtXY(_thd.selstart2.x, _thd.selstart2.y),
TileVirtXY(_thd.selend2.x, _thd.selend2.y),
_thd.cm_poly_dir2);
}
}
if (_thd.cm != _thd.cm_new) {
_thd.cm.MarkDirty();
_thd.cm = _thd.cm_new;

View File

@@ -45,6 +45,7 @@
#include "table/sprites.h"
#include "table/strings.h"
#include "debug.h"
#include "safeguards.h"

View File

@@ -1089,9 +1089,9 @@ struct BuildRailToolbarWindow : Window {
EventState CM_OnFnModStateChange() override
{
if (_settings_client.gui.cm_enable_polyrail_terraform && this->IsWidgetLowered(WID_RAT_POLYRAIL)) {
return ES_HANDLED;
}
// if (_settings_client.gui.cm_enable_polyrail_terraform && this->IsWidgetLowered(WID_RAT_POLYRAIL)) {
// return ES_HANDLED;
// }
return ES_NOT_HANDLED;
}