author | rubidium |
Sun, 25 May 2008 19:17:03 +0000 | |
changeset 9354 | 845e07db4549 |
parent 9111 | 48ce04029fe4 |
child 9358 | 2e1e4d2f71dd |
permissions | -rw-r--r-- |
8091
674be8638d74
(svn r11652) -Codechange: add the svn $ header for several files
smatz
parents:
7832
diff
changeset
|
1 |
/* $Id$ */ |
674be8638d74
(svn r11652) -Codechange: add the svn $ header for several files
smatz
parents:
7832
diff
changeset
|
2 |
|
9111
48ce04029fe4
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents:
9070
diff
changeset
|
3 |
/** @file road.cpp Generic road related functions. */ |
48ce04029fe4
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents:
9070
diff
changeset
|
4 |
|
7641
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
5 |
#include "stdafx.h" |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
6 |
#include "openttd.h" |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
7 |
#include "rail_map.h" |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
8 |
#include "road_map.h" |
8102
906a3d3b6df1
(svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
8091
diff
changeset
|
9 |
#include "road_internal.h" |
7641
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
10 |
#include "water_map.h" |
8236
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
11 |
#include "genworld.h" |
8254
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
8236
diff
changeset
|
12 |
#include "player_func.h" |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
8236
diff
changeset
|
13 |
#include "player_base.h" |
8786
1823ff88a054
(svn r12490) -Codechange: rename engine.h to engine_func.h and remove unneeded inclusions of engine.h and/or replace them with engine_type.h.
rubidium
parents:
8387
diff
changeset
|
14 |
#include "engine_func.h" |
9070
dd0121143eba
(svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist.
peter1138
parents:
9065
diff
changeset
|
15 |
#include "engine_base.h" |
8236
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
16 |
#include "settings_type.h" |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
17 |
#include "date_func.h" |
7641
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
18 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
19 |
bool IsPossibleCrossing(const TileIndex tile, Axis ax) |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
20 |
{ |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
21 |
return (IsTileType(tile, MP_RAILWAY) && |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
22 |
!HasSignals(tile) && |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
23 |
GetTrackBits(tile) == (ax == AXIS_X ? TRACK_BIT_Y : TRACK_BIT_X) && |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
24 |
GetTileSlope(tile, NULL) == SLOPE_FLAT); |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
25 |
} |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
26 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
27 |
RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb) |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
28 |
{ |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
29 |
for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) { |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
30 |
const TileIndex neighbor_tile = TileAddByDiagDir(tile, dir); |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
31 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
32 |
/* Get the Roadbit pointing to the neighbor_tile */ |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
33 |
const RoadBits target_rb = DiagDirToRoadBits(dir); |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
34 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
35 |
/* If the roadbit is in the current plan */ |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
36 |
if (org_rb & target_rb) { |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
37 |
bool connective = false; |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
38 |
const RoadBits mirrored_rb = MirrorRoadBits(target_rb); |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
39 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
40 |
switch (GetTileType(neighbor_tile)) { |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
41 |
/* Allways connective ones */ |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
42 |
case MP_CLEAR: case MP_TREES: |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
43 |
connective = true; |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
44 |
break; |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
45 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
46 |
/* The conditionaly connective ones */ |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
47 |
case MP_TUNNELBRIDGE: |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
48 |
case MP_STATION: |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
49 |
case MP_ROAD: { |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
50 |
const RoadBits neighbor_rb = GetAnyRoadBits(neighbor_tile, ROADTYPE_ROAD) | GetAnyRoadBits(neighbor_tile, ROADTYPE_TRAM); |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
51 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
52 |
/* Accept only connective tiles */ |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
53 |
connective = (neighbor_rb & mirrored_rb) || // Neighbor has got the fitting RoadBit |
7832
60035eb28f08
(svn r11382) -Codechange: renamed COUNTBITS to CountBits, as it is no longer a macro (skidd13)
truelight
parents:
7641
diff
changeset
|
54 |
CountBits(neighbor_rb) == 1; // Neighbor has got only one Roadbit |
7641
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
55 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
56 |
} break; |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
57 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
58 |
case MP_RAILWAY: |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
59 |
connective = IsPossibleCrossing(neighbor_tile, DiagDirToAxis(dir)); |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
60 |
break; |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
61 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
62 |
case MP_WATER: |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
63 |
/* Check for real water tile */ |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
64 |
connective = !IsWater(neighbor_tile); |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
65 |
break; |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
66 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
67 |
/* The defentetly not connective ones */ |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
68 |
default: break; |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
69 |
} |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
70 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
71 |
/* If the neighbor tile is inconnective remove the planed road connection to it */ |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
72 |
if (!connective) org_rb ^= target_rb; |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
73 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
74 |
} |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
75 |
} |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
76 |
|
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
77 |
return org_rb; |
3a75903fd892
(svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents:
diff
changeset
|
78 |
} |
8236
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
79 |
|
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
80 |
bool HasRoadTypesAvail(const PlayerID p, const RoadTypes rts) |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
81 |
{ |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
82 |
RoadTypes avail_roadtypes; |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
83 |
|
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
84 |
if (p == OWNER_TOWN || _game_mode == GM_EDITOR || IsGeneratingWorld()) { |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
85 |
avail_roadtypes = ROADTYPES_ROAD; |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
86 |
} else { |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
87 |
if (!IsValidPlayer(p)) return false; |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
88 |
avail_roadtypes = (RoadTypes)GetPlayer(p)->avail_roadtypes | ROADTYPES_ROAD; // road is available for always for everybody |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
89 |
} |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
90 |
return (rts & ~avail_roadtypes) == 0; |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
91 |
} |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
92 |
|
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
93 |
bool ValParamRoadType(const RoadType rt) |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
94 |
{ |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
95 |
return HasRoadTypesAvail(_current_player, RoadTypeToRoadTypes(rt)); |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
96 |
} |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
97 |
|
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
98 |
RoadTypes GetPlayerRoadtypes(PlayerID p) |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
99 |
{ |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
100 |
RoadTypes rt = ROADTYPES_NONE; |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
101 |
|
9070
dd0121143eba
(svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist.
peter1138
parents:
9065
diff
changeset
|
102 |
Engine *e; |
dd0121143eba
(svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist.
peter1138
parents:
9065
diff
changeset
|
103 |
FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) { |
dd0121143eba
(svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist.
peter1138
parents:
9065
diff
changeset
|
104 |
const EngineInfo *ei = &e->info; |
8236
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
105 |
|
8387
a237d60274da
(svn r11957) -Codechange [FS#1678]: Minor simplification and optimisation when checking for available road/rail types (bilbo)
peter1138
parents:
8254
diff
changeset
|
106 |
if (HasBit(ei->climates, _opt.landscape) && |
8236
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
107 |
(HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) { |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
108 |
SetBit(rt, HasBit(ei->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD); |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
109 |
} |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
110 |
} |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
111 |
|
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
112 |
return rt; |
8a5dd0b42e47
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8131
diff
changeset
|
113 |
} |