equal
deleted
inserted
replaced
189 } |
189 } |
190 |
190 |
191 FORCEINLINE int PlatformLengthPenalty(int platform_length) |
191 FORCEINLINE int PlatformLengthPenalty(int platform_length) |
192 { |
192 { |
193 int cost = 0; |
193 int cost = 0; |
194 const Vehicle* v = Yapf().GetVehicle(); |
194 const Vehicle *v = Yapf().GetVehicle(); |
195 assert(v != NULL); |
195 assert(v != NULL); |
196 assert(v->type == VEH_TRAIN); |
196 assert(v->type == VEH_TRAIN); |
197 assert(v->u.rail.cached_total_length != 0); |
197 assert(v->u.rail.cached_total_length != 0); |
198 int needed_platform_length = (v->u.rail.cached_total_length + TILE_SIZE - 1) / TILE_SIZE; |
198 int needed_platform_length = (v->u.rail.cached_total_length + TILE_SIZE - 1) / TILE_SIZE; |
199 if (platform_length > needed_platform_length) { |
199 if (platform_length > needed_platform_length) { |
259 * cost of segment entry (move from the 'parent' node) is not included! |
259 * cost of segment entry (move from the 'parent' node) is not included! |
260 */ |
260 */ |
261 int segment_entry_cost = 0; |
261 int segment_entry_cost = 0; |
262 int segment_cost = 0; |
262 int segment_cost = 0; |
263 |
263 |
264 const Vehicle* v = Yapf().GetVehicle(); |
264 const Vehicle *v = Yapf().GetVehicle(); |
265 |
265 |
266 // start at n.m_key.m_tile / n.m_key.m_td and walk to the end of segment |
266 // start at n.m_key.m_tile / n.m_key.m_td and walk to the end of segment |
267 TILE cur(n.m_key.m_tile, n.m_key.m_td); |
267 TILE cur(n.m_key.m_tile, n.m_key.m_td); |
268 |
268 |
269 // the previous tile will be needed for transition cost calculations |
269 // the previous tile will be needed for transition cost calculations |