depot.h
changeset 3179 8ef3e8028af5
parent 3147 fc76d566a68e
child 3185 a9d0cdff7b84
equal deleted inserted replaced
3178:f41cd14f6034 3179:8ef3e8028af5
     6 /** @file depot.h Header files for depots (not hangars)
     6 /** @file depot.h Header files for depots (not hangars)
     7   * @see depot.c */
     7   * @see depot.c */
     8 
     8 
     9 #include "direction.h"
     9 #include "direction.h"
    10 #include "pool.h"
    10 #include "pool.h"
       
    11 #include "road_map.h"
    11 #include "tile.h"
    12 #include "tile.h"
    12 #include "variables.h"
    13 #include "variables.h"
    13 
    14 
    14 struct Depot {
    15 struct Depot {
    15 	TileIndex xy;
    16 	TileIndex xy;
   100 {
   101 {
   101 	assert(IsTileDepotType(tile, type));
   102 	assert(IsTileDepotType(tile, type));
   102 
   103 
   103 	switch (type)
   104 	switch (type)
   104 	{
   105 	{
   105 		case TRANSPORT_RAIL:
   106 		case TRANSPORT_RAIL: return (DiagDirection)GB(_m[tile].m5, 0, 2);
   106 		case TRANSPORT_ROAD:
   107 		case TRANSPORT_ROAD: return GetRoadDepotDirection(tile);
   107 			/* Rail and road store a diagonal direction in bits 0 and 1 */
       
   108 			return (DiagDirection)GB(_m[tile].m5, 0, 2);
       
   109 		case TRANSPORT_WATER:
   108 		case TRANSPORT_WATER:
   110 			/* Water is stubborn, it stores the directions in a different order. */
   109 			/* Water is stubborn, it stores the directions in a different order. */
   111 			switch (GB(_m[tile].m5, 0, 2)) {
   110 			switch (GB(_m[tile].m5, 0, 2)) {
   112 				case 0: return DIAGDIR_NE;
   111 				case 0: return DIAGDIR_NE;
   113 				case 1: return DIAGDIR_SW;
   112 				case 1: return DIAGDIR_SW;