File diff r9487:ae7979d51839 → r9488:2873382f8f4a
src/train_cmd.cpp
Show inline comments
 
@@ -549,7 +549,7 @@ static CommandCost CmdBuildRailWagon(Eng
 
		if (!IsCompatibleRail(rvi->railtype, GetRailType(tile))) return CMD_ERROR;
 

	
 
		/* Allow for the wagon and the articulated parts, plus one to "terminate" the list. */
 
		Vehicle **vl = (Vehicle**)alloca(sizeof(*vl) * (num_vehicles + 1));
 
		Vehicle **vl = AllocaM(Vehicle*, num_vehicles + 1);
 
		memset(vl, 0, sizeof(*vl) * (num_vehicles + 1));
 

	
 
		if (!Vehicle::AllocateList(vl, num_vehicles))
 
@@ -716,7 +716,7 @@ CommandCost CmdBuildRailVehicle(TileInde
 
		if (!HasPowerOnRail(rvi->railtype, GetRailType(tile))) return CMD_ERROR;
 

	
 
		/* Allow for the dual-heads and the articulated parts, plus one to "terminate" the list. */
 
		Vehicle **vl = (Vehicle**)alloca(sizeof(*vl) * (num_vehicles + 1));
 
		Vehicle **vl = AllocaM(Vehicle*, num_vehicles + 1);
 
		memset(vl, 0, sizeof(*vl) * (num_vehicles + 1));
 

	
 
		if (!Vehicle::AllocateList(vl, num_vehicles)) {