(svn r22226) -Codechange: When autoreplace invalidates vehicle windows because the Vehicle index changed, use a better eye-catcher-'data' than 0 to identify them.

This commit is contained in:
frosch
2011-03-08 19:41:58 +00:00
parent 31f46c0786
commit 9cf92e2bd2
3 changed files with 27 additions and 3 deletions

View File

@@ -246,9 +246,10 @@ struct TimetableWindow : Window {
virtual void OnInvalidateData(int data)
{
switch (data) {
case 0:
case -666:
/* Autoreplace replaced the vehicle */
this->vehicle = Vehicle::Get(this->window_number);
/* This case is _not_ called asynchronously. Get out directly, rest can be done later */
break;
case -1: