Changeset - r19983:2df3f9831582
[Not reviewed]
master
0 2 0
peter1138 - 12 years ago 2013-01-23 20:00:00
peter1138@openttd.org
(svn r24939) -Fix: Redraw autoreplace window properly in network games.
2 files changed with 1 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/autoreplace_cmd.cpp
Show inline comments
 
@@ -763,13 +763,13 @@ CommandCost CmdSetAutoReplace(TileIndex 
 
	} else {
 
		cost = RemoveEngineReplacementForCompany(c, old_engine_type, id_g, flags);
 
	}
 

	
 
	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);
 

	
 
	return cost;
 
}
 

	
src/autoreplace_gui.cpp
Show inline comments
 
@@ -183,13 +183,12 @@ class ReplaceVehicleWindow : public Wind
 
	 */
 
	void ReplaceClick_StartReplace(bool replace_when_old)
 
	{
 
		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:
 
	ReplaceVehicleWindow(const WindowDesc *desc, VehicleType vehicletype, GroupID id_g) : Window()
 
	{
 
		if (vehicletype == VEH_TRAIN) {
 
@@ -452,13 +451,12 @@ public:
 
				break;
 
			}
 

	
 
			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;
 
			}
 

	
 
			case WID_RV_LEFT_MATRIX:
 
			case WID_RV_RIGHT_MATRIX: {
 
				byte click_side;
0 comments (0 inline, 0 general)