Fix crash in station joining highlight

This commit is contained in:
dP
2024-03-13 16:42:38 +07:00
parent 701f115dd7
commit faa0cecd07
3 changed files with 22 additions and 0 deletions
+17
View File
@@ -155,12 +155,29 @@ void OnStationTileSetChange(const Station *station, bool adding, StationType typ
if (station == _viewport_highlight_station) MarkCoverageAreaDirty(_viewport_highlight_station);
}
void OnStationDeleted(const Station *station) {
if (_highlight_station_to_join == station) {
MarkCoverageAreaDirty(station);
_highlight_station_to_join = nullptr;
}
}
const Station *_last_built_station;
void OnStationPartBuilt(const Station *station) {
_last_built_station = station;
CheckRedrawStationCoverage();
}
void OnStationRemoved(const Station *station) {
if (_last_built_station == station) _last_built_station = nullptr;
if (_station_to_join == station) {
// TODO MarkJoinHighlight
MarkCoverageAreaDirty(station);
_station_to_join = nullptr;
}
}
const Station *CheckClickOnDeadStationSign() {
int x = _cursor.pos.x;
int y = _cursor.pos.y;