oldloader.c
branch0.5
changeset 5507 65cf99137628
parent 5500 636a87c38ec1
child 5527 cffb9a72506e
equal deleted inserted replaced
5506:3c868cae4b22 5507:65cf99137628
    17 #include "debug.h"
    17 #include "debug.h"
    18 #include "depot.h"
    18 #include "depot.h"
    19 #include "network.h"
    19 #include "network.h"
    20 #include "ai/ai.h"
    20 #include "ai/ai.h"
    21 #include "date.h"
    21 #include "date.h"
       
    22 #include "bridge_map.h"
    22 
    23 
    23 enum {
    24 enum {
    24 	HEADER_SIZE = 49,
    25 	HEADER_SIZE = 49,
    25 	BUFFER_SIZE = 4096,
    26 	BUFFER_SIZE = 4096,
    26 
    27 
   353 			if (v->orders == u->orders) {
   354 			if (v->orders == u->orders) {
   354 				v->next_shared = u;
   355 				v->next_shared = u;
   355 				u->prev_shared = v;
   356 				u->prev_shared = v;
   356 				break;
   357 				break;
   357 			}
   358 			}
       
   359 		}
       
   360 
       
   361 		if (IsBridgeTile(v->tile) && IsBridgeRamp(v->tile) &&
       
   362 				(v->z_pos & (TILE_HEIGHT - 1)) == (TILE_HEIGHT - 1)) {
       
   363 			/* Under some circumstances the trains going up a ramp can be one
       
   364 			 * pixel too low when they enter the bridge. This causes the train
       
   365 			 * to "disappear" under the bridge, which causes the train to
       
   366 			 * break into two pieces and crash slightly later.
       
   367 			 *
       
   368 			 * This "hack" will make the trains on those positions on the
       
   369 			 * ramps run one pixel higher. This offset will be automatically
       
   370 			 * "fixed" when it enters the bridge middle parts or when it
       
   371 			 * drives down the ramp of the bridge.
       
   372 			 */
       
   373 			v->z_pos++;
   358 		}
   374 		}
   359 	}
   375 	}
   360 }
   376 }
   361 
   377 
   362 /*
   378 /*