diff options
author | frosch <frosch@openttd.org> | 2011-03-13 21:33:30 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-03-13 21:33:30 +0000 |
commit | dd208232770650342d681f50e801b1f2de03aa61 (patch) | |
tree | f5fcc032294467d30e79c92bce794da98f0d386e /src/vehicle_gui.cpp | |
parent | f051a81b4e5064f6b5c1d00f4a7d0ae38f768e35 (diff) | |
download | openttd-dd208232770650342d681f50e801b1f2de03aa61.tar.xz |
(svn r22245) -Codechange: Make vehicle lists handle command-/GUI-scope invalidations themself.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index a20e44a67..2974c351f 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1609,13 +1609,14 @@ public: */ virtual void OnInvalidateData(int data = 0, bool gui_scope = true) { - if (!gui_scope) return; - if (HasBit(data, 31) && this->vli.type == VL_SHARED_ORDERS) { + if (!gui_scope && HasBit(data, 31) && this->vli.type == VL_SHARED_ORDERS) { + /* Needs to be done in command-scope, so everything stays valid */ this->vli.index = GB(data, 0, 20); this->window_number = this->vli.Pack(); this->vehicles.ForceRebuild(); return; } + if (!gui_scope) return; /* We can only set the trigger for resorting/rebuilding. * We cannot safely resort at this point, as there might be multiple scheduled invalidations, |