summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2013-01-23 20:00:00 +0000
committerpeter1138 <peter1138@openttd.org>2013-01-23 20:00:00 +0000
commit13e86568048ebb36b80b6e825a605b31bc641413 (patch)
treeb80843dc17f6c20747440a68d4a116c91de5a3a5
parentf563250c0b9fa051d81481d88dbd8767730703d9 (diff)
downloadopenttd-13e86568048ebb36b80b6e825a605b31bc641413.tar.xz
(svn r24939) -Fix: Redraw autoreplace window properly in network games.
-rw-r--r--src/autoreplace_cmd.cpp2
-rw-r--r--src/autoreplace_gui.cpp2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 8d981c52a..6afcc48d1 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -766,7 +766,7 @@ CommandCost CmdSetAutoReplace(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
if (flags & DC_EXEC) {
GroupStatistics::UpdateAutoreplace(_current_company);
- SetWindowClassesDirty(GetWindowClassForVehicleType(Engine::Get(old_engine_type)->type));
+ if (IsLocalCompany()) SetWindowDirty(WC_REPLACE_VEHICLE, Engine::Get(old_engine_type)->type);
}
if ((flags & DC_EXEC) && IsLocalCompany()) InvalidateAutoreplaceWindow(old_engine_type, id_g);
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index a1b663c9f..ef7cbdb56 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -186,7 +186,6 @@ class ReplaceVehicleWindow : public Window {
EngineID veh_from = this->sel_engine[0];
EngineID veh_to = this->sel_engine[1];
DoCommandP(0, (replace_when_old ? 1 : 0) | (this->sel_group << 16), veh_from + (veh_to << 16), CMD_SET_AUTOREPLACE);
- this->SetDirty();
}
public:
@@ -455,7 +454,6 @@ public:
case WID_RV_STOP_REPLACE: { // Stop replacing
EngineID veh_from = this->sel_engine[0];
DoCommandP(0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16), CMD_SET_AUTOREPLACE);
- this->SetDirty();
break;
}