diff options
author | frosch <frosch@openttd.org> | 2011-02-23 20:54:55 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-02-23 20:54:55 +0000 |
commit | 19b7249adee1dba623ba4ee69266cd13888deb3d (patch) | |
tree | 4f399e2587ff32b008c60b8f6211e1f7021f5210 /src/train_cmd.cpp | |
parent | 40cc3324fadce60522e97791604ae3a6643f4c2e (diff) | |
download | openttd-19b7249adee1dba623ba4ee69266cd13888deb3d.tar.xz |
(svn r22135) -Fix [FS#4523]: When commands need to invalidate windows, process these events asynchronously before the next redraw. Calling window code directly from command scope uses wrong _current_company and might issue nested DoCommands() which interfer with the running command.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 754ae9198..e8beb46a6 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -264,7 +264,7 @@ void Train::ConsistChanged(bool same_length) if (this->IsFrontEngine()) { this->UpdateAcceleration(); SetWindowDirty(WC_VEHICLE_DETAILS, this->index); - InvalidateWindowData(WC_VEHICLE_REFIT, this->index); + InvalidateWindowData(WC_VEHICLE_REFIT, this->index); // Important, do not invalidate immediatelly. The refit window tests commands. } } @@ -1089,7 +1089,7 @@ static void NormaliseTrainHead(Train *head) if (!head->IsFrontEngine()) return; /* Update the refit button and window */ - InvalidateWindowData(WC_VEHICLE_REFIT, head->index); + InvalidateWindowData(WC_VEHICLE_REFIT, head->index); // Important, do not invalidate immediatelly. The refit window tests commands. SetWindowWidgetDirty(WC_VEHICLE_VIEW, head->index, VVW_WIDGET_REFIT_VEH); /* If we don't have a unit number yet, set one. */ |