summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorSamuXarick <43006711+SamuXarick@users.noreply.github.com>2021-09-14 21:10:00 +0100
committerGitHub <noreply@github.com>2021-09-14 22:10:00 +0200
commita57c2b073a6f40a90479cf9eeb916b282fe7c999 (patch)
tree5a80f33e7a82b1a3ef410d5116fb1cd065da90d0 /src/vehicle.cpp
parent37de87812994be72399a9588473ece1c514397c0 (diff)
downloadopenttd-a57c2b073a6f40a90479cf9eeb916b282fe7c999.tar.xz
Feature: Display icon/text whether vehicle is lost in vehicle (list) window (#9543)
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 6df16caf6..9e2292751 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -778,6 +778,8 @@ void Vehicle::HandlePathfindingResult(bool path_found)
/* Clear the flag as the PF's problem was solved. */
ClrBit(this->vehicle_flags, VF_PATHFINDER_LOST);
+ SetWindowWidgetDirty(WC_VEHICLE_VIEW, this->index, WID_VV_START_STOP);
+ InvalidateWindowClassesData(GetWindowClassForVehicleType(this->type));
/* Delete the news item. */
DeleteVehicleNews(this->index, STR_NEWS_VEHICLE_IS_LOST);
return;
@@ -788,6 +790,8 @@ void Vehicle::HandlePathfindingResult(bool path_found)
/* It is first time the problem occurred, set the "lost" flag. */
SetBit(this->vehicle_flags, VF_PATHFINDER_LOST);
+ SetWindowWidgetDirty(WC_VEHICLE_VIEW, this->index, WID_VV_START_STOP);
+ InvalidateWindowClassesData(GetWindowClassForVehicleType(this->type));
/* Notify user about the event. */
AI::NewEvent(this->owner, new ScriptEventVehicleLost(this->index));
if (_settings_client.gui.lost_vehicle_warn && this->owner == _local_company) {