Changeset - r15901:cfd8b9cbbc17
[Not reviewed]
master
0 1 0
frosch - 14 years ago 2010-08-22 19:15:47
frosch@openttd.org
(svn r20595) -Fix (r20536)[FS#4068]: Autoreplace needs refitting of wagons in free wagon chains.
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/vehicle_cmd.cpp
Show inline comments
 
@@ -314,13 +314,15 @@ CommandCost CmdRefitVehicle(TileIndex ti
 
	Vehicle *v = Vehicle::GetIfValid(p1);
 
	if (v == NULL) return CMD_ERROR;
 

	
 
	/* Don't allow disasters and sparks and such to be refitted.
 
	 * We cannot check for IsPrimaryVehicle as autoreplace also refits in free wagon chains. */
 
	if (!IsCompanyBuildableVehicleType(v->type)) return CMD_ERROR;
 

	
 
	Vehicle *front = v->First();
 

	
 
	CommandCost ret = CheckOwnership(front->owner);
 
	if (ret.Failed()) return ret;
 

	
 
	/* Don't allow disasters and sparks and such to be refitted. */
 
	if (!front->IsPrimaryVehicle()) return CMD_ERROR;
 
	/* Don't allow shadows and such to be refitted. */
 
	if (v != front && (v->type == VEH_SHIP || v->type == VEH_AIRCRAFT)) return CMD_ERROR;
 
	if (!front->IsStoppedInDepot()) return_cmd_error(STR_ERROR_TRAIN_MUST_BE_STOPPED_INSIDE_DEPOT + front->type);
0 comments (0 inline, 0 general)