equal
deleted
inserted
replaced
102 switch (type) |
102 switch (type) |
103 { |
103 { |
104 case TRANSPORT_RAIL: |
104 case TRANSPORT_RAIL: |
105 case TRANSPORT_ROAD: |
105 case TRANSPORT_ROAD: |
106 /* Rail and road store a diagonal direction in bits 0 and 1 */ |
106 /* Rail and road store a diagonal direction in bits 0 and 1 */ |
107 return (DiagDirection)(_m[tile].m5 & 3); |
107 return (DiagDirection)GB(_m[tile].m5, 0, 2); |
108 case TRANSPORT_WATER: |
108 case TRANSPORT_WATER: |
109 /* Water is stubborn, it stores the directions in a different order. */ |
109 /* Water is stubborn, it stores the directions in a different order. */ |
110 switch (_m[tile].m5 & 3) { |
110 switch (GB(_m[tile].m5, 0, 2)) { |
111 case 0: return DIAGDIR_NE; |
111 case 0: return DIAGDIR_NE; |
112 case 1: return DIAGDIR_SW; |
112 case 1: return DIAGDIR_SW; |
113 case 2: return DIAGDIR_NW; |
113 case 2: return DIAGDIR_NW; |
114 case 3: return DIAGDIR_SE; |
114 case 3: return DIAGDIR_SE; |
115 } |
115 } |