src/yapf/yapf_costrail.hpp
branchcpp_gui
changeset 6298 c30fe89622df
parent 6268 4b5241e5dd10
equal deleted inserted replaced
6297:4bf29d14edba 6298:c30fe89622df
   152 	FORCEINLINE int PlatformLengthPenalty(int platform_length)
   152 	FORCEINLINE int PlatformLengthPenalty(int platform_length)
   153 	{
   153 	{
   154 		int cost = 0;
   154 		int cost = 0;
   155 		const Vehicle* v = Yapf().GetVehicle();
   155 		const Vehicle* v = Yapf().GetVehicle();
   156 		assert(v != NULL);
   156 		assert(v != NULL);
   157 		assert(v->type == VEH_Train);
   157 		assert(v->type == VEH_TRAIN);
   158 		assert(v->u.rail.cached_total_length != 0);
   158 		assert(v->u.rail.cached_total_length != 0);
   159 		int needed_platform_length = (v->u.rail.cached_total_length + TILE_SIZE - 1) / TILE_SIZE;
   159 		int needed_platform_length = (v->u.rail.cached_total_length + TILE_SIZE - 1) / TILE_SIZE;
   160 		if (platform_length > needed_platform_length) {
   160 		if (platform_length > needed_platform_length) {
   161 			// apply penalty for longer platform than needed
   161 			// apply penalty for longer platform than needed
   162 			cost += Yapf().PfGetSettings().rail_longer_platform_penalty;
   162 			cost += Yapf().PfGetSettings().rail_longer_platform_penalty;