mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-09-15 04:49:36 +00:00
Compare commits
216
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1959e213b2 | ||
|
|
974c0f5166 | ||
|
|
00a766ed27 | ||
|
|
1cd4b3bb86 | ||
|
|
09601fe35d | ||
|
|
bbd308adef | ||
|
|
0fe0225751 | ||
|
|
773c6765e6 | ||
|
|
c85d350310 | ||
|
|
46b3d114a8 | ||
|
|
4355231f67 | ||
|
|
4c5ca17486 | ||
|
|
71f4067d19 | ||
|
|
313c1bc171 | ||
|
|
2ad1279725 | ||
|
|
3057a26fd5 | ||
|
|
732a0d069a | ||
|
|
c70ee16ecf | ||
|
|
053420399a | ||
|
|
f3e550e9bd | ||
|
|
a4bf3be864 | ||
|
|
3bfad0243b | ||
|
|
547421496e | ||
|
|
bbe94dc497 | ||
|
|
a42c0ea88b | ||
|
|
8118f74575 | ||
|
|
54161949d1 | ||
|
|
e846701b3c | ||
|
|
0364726bbb | ||
|
|
b15719bbd2 | ||
|
|
0ebc548a89 | ||
|
|
1a971fb6d6 | ||
|
|
9765a297e7 | ||
|
|
2e1eafbdc3 | ||
|
|
49ea0e9092 | ||
|
|
a97d52a29a | ||
|
|
67a5cd0b18 | ||
|
|
8f67baae2e | ||
|
|
da0b09557c | ||
|
|
df8c4bdbfa | ||
|
|
3d34b9e4a2 | ||
|
|
1e65afc62a | ||
|
|
f48838ef3f | ||
|
|
eea2f90da7 | ||
|
|
734994c9ba | ||
|
|
50b0e10026 | ||
|
|
9626e0bf2b | ||
|
|
23ffef05ce | ||
|
|
3cd1f15523 | ||
|
|
5e82fee690 | ||
|
|
62e5afcdf8 | ||
|
|
a7634b399d | ||
|
|
ab4c419fcf | ||
|
|
430fda01dc | ||
|
|
b4a175ba41 | ||
|
|
982de9cf86 | ||
|
|
4fff63d790 | ||
|
|
b11f1bd4ed | ||
|
|
12b64a12b0 | ||
|
|
8017c2a3d7 | ||
|
|
2bec6123f7 | ||
|
|
83ad2c4dfa | ||
|
|
4c37e0ec2c | ||
|
|
072f6d67ef | ||
|
|
25a22ec255 | ||
|
|
9a1c0f139a | ||
|
|
3f103c35a6 | ||
|
|
967bb84af3 | ||
|
|
890a18c738 | ||
|
|
81ef0dbcfc | ||
|
|
0de8332366 | ||
|
|
1339d75f75 | ||
|
|
d74fc0bee3 | ||
|
|
7eadf07e44 | ||
|
|
0537672324 | ||
|
|
cc8da3e5ab | ||
|
|
03fb95f92f | ||
|
|
7eba2bf4d3 | ||
|
|
849772f0fd | ||
|
|
9e8db65223 | ||
|
|
6ff844e7c4 | ||
|
|
eb299736c1 | ||
|
|
0cdb1c78cd | ||
|
|
c9bd9b0c23 | ||
|
|
8b9f0d5ade | ||
|
|
e860075a16 | ||
|
|
2a2363e819 | ||
|
|
a6fcd78538 | ||
|
|
e308c348f0 | ||
|
|
46dfdfd72b | ||
|
|
4432f7799d | ||
|
|
6dc24cf643 | ||
|
|
656caf16db | ||
|
|
1ac51128f5 | ||
|
|
698d840581 | ||
|
|
060b2b736b | ||
|
|
2d6ebd3bf4 | ||
|
|
fa64ae9b3a | ||
|
|
289206b033 | ||
|
|
4682434bc9 | ||
|
|
2f6c840ebf | ||
|
|
6a2ae92811 | ||
|
|
89a135293a | ||
|
|
6435a89c28 | ||
|
|
d426906a01 | ||
|
|
be44f1306f | ||
|
|
b5468e7a80 | ||
|
|
613743538d | ||
|
|
cfbbcf1597 | ||
|
|
10a7678beb | ||
|
|
22922414eb | ||
|
|
3f9fa65a42 | ||
|
|
795a528328 | ||
|
|
e54a1f6721 | ||
|
|
e95718bf43 | ||
|
|
c9609bbbc2 | ||
|
|
a82118f360 | ||
|
|
2707186f6a | ||
|
|
07e14525b8 | ||
|
|
922d60f516 | ||
|
|
9ca4b629cd | ||
|
|
7efd7e19ed | ||
|
|
6c9078fd30 | ||
|
|
d89095b3ec | ||
|
|
b8c9988d9f | ||
|
|
6371b75bcc | ||
|
|
5f28591610 | ||
|
|
73da045f50 | ||
|
|
561449992a | ||
|
|
22d17aa745 | ||
|
|
c0b051eb33 | ||
|
|
772de6b52d | ||
|
|
488b525161 | ||
|
|
6a17bf91e3 | ||
|
|
3f900d3580 | ||
|
|
39d7f3b2bd | ||
|
|
ff6aeb8791 | ||
|
|
39c5cfc5d1 | ||
|
|
2f4a77f47e | ||
|
|
b3fdf69ab5 | ||
|
|
62128e8263 | ||
|
|
805afdb002 | ||
|
|
92b90d877e | ||
|
|
82346d4608 | ||
|
|
32cd182ecc | ||
|
|
4a203e8a49 | ||
|
|
1e7c3fd2ff | ||
|
|
a2297dc594 | ||
|
|
b8559492b5 | ||
|
|
7ab524b048 | ||
|
|
9b4beb0a5c | ||
|
|
7645c5ac43 | ||
|
|
6e4dd56158 | ||
|
|
4d8a93c870 | ||
|
|
a1df4bea68 | ||
|
|
89f245ab2f | ||
|
|
1d3ce9ef1b | ||
|
|
bd9f07e5a0 | ||
|
|
4784c3ac3c | ||
|
|
bc9afec3b0 | ||
|
|
53c9846f14 | ||
|
|
93b26e8e3d | ||
|
|
0ab078158e | ||
|
|
679cd3c21b | ||
|
|
2709454040 | ||
|
|
7be31ee03e | ||
|
|
0c497dd113 | ||
|
|
1b3e2309df | ||
|
|
804542b3f3 | ||
|
|
6b86ee9888 | ||
|
|
080a941eda | ||
|
|
85255ea001 | ||
|
|
75351f4043 | ||
|
|
110e25e859 | ||
|
|
26eb9eb7e2 | ||
|
|
c6b46725db | ||
|
|
c58a910c8e | ||
|
|
fad00367ae | ||
|
|
93ae848b0a | ||
|
|
6cb017456a | ||
|
|
c53c869556 | ||
|
|
d811238dd0 | ||
|
|
ff469ab352 | ||
|
|
ee67d10c80 | ||
|
|
3d1008318b | ||
|
|
09d7f172a6 | ||
|
|
28676531b0 | ||
|
|
1b237216a8 | ||
|
|
eb2b510e01 | ||
|
|
87dade4698 | ||
|
|
998246430a | ||
|
|
e8e535f58c | ||
|
|
ab91d8eb4f | ||
|
|
313654f18d | ||
|
|
b1546da65e | ||
|
|
00f9a36645 | ||
|
|
0e802c462d | ||
|
|
49e191cc8e | ||
|
|
12b4fa7dba | ||
|
|
7e6ccf3a0a | ||
|
|
60874f88d0 | ||
|
|
4eb4aad54f | ||
|
|
57c6133c3b | ||
|
|
da09ebc59a | ||
|
|
beb7f63746 | ||
|
|
91e95dfd53 | ||
|
|
352fd000ea | ||
|
|
f5364269b5 | ||
|
|
9d8496e65e | ||
|
|
3281b91c48 | ||
|
|
0a16e4ee91 | ||
|
|
dbef775e76 | ||
|
|
d8567d2699 | ||
|
|
ec54970058 | ||
|
|
bd72b9d2a4 | ||
|
|
9845f10668 |
@@ -319,3 +319,5 @@ AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
|
||||
AIAbstractList <- AIList;
|
||||
|
||||
AIList.ChangeItem <- AIList.SetValue;
|
||||
|
||||
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;
|
||||
|
||||
@@ -70,3 +70,5 @@ AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
|
||||
AIAbstractList <- AIList;
|
||||
|
||||
AIList.ChangeItem <- AIList.SetValue;
|
||||
|
||||
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;
|
||||
|
||||
@@ -15,3 +15,6 @@ regression =
|
||||
[vehicle]
|
||||
road_side = right
|
||||
plane_speed = 2
|
||||
|
||||
[construction]
|
||||
max_bridge_length = 100
|
||||
|
||||
+76
-1
@@ -1,3 +1,78 @@
|
||||
1.1.0-beta5 (2011-02-04)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: GUI setting to disable reversing at signals (r21962)
|
||||
- Feature: Not loading and not unloading is now possible (r21961)
|
||||
- Change: [NewGRF] Disable the flipping of train engines/wagons in the depot by default for NewGRFs [FS#4462] (r21966)
|
||||
- Change: Show the length of vehicles in tiles, instead of half tiles in the depot (r21960)
|
||||
- Change: Replace longbridges settings with custom maximum bridge and tunnel length setting (r21959)
|
||||
- Change: Randomize the vehicle a small UFO targets, do not use the one with lowest index (r21949)
|
||||
- Fix: Do not count the number of vehicles but the length of vehicles to (configurably) limit train length [FS#4461] (r21960)
|
||||
- Fix: [NewGRF] Reset the carry flag every 4 bytes in Action 6 when adding more than one variable (r21951)
|
||||
- Fix: Road vehicle was moved under the bridge when it was destroyed by an UFO while on a bridge (r21948)
|
||||
- Fix: Crash when converting a savegame with vehicles crashed in a tunnel entry, or with vehicles reversing there (r21947)
|
||||
- Fix: Funny behaviour when a road vehicle reverses while overtaking, so abort the overtake attempt when reversing the road vehicle [FS#4447] (r21946)
|
||||
- Fix: Not all vehicles should be tested to be inside a tunnel upon savegame load [FS#4460] (r21940)
|
||||
- Fix: Do not remove existing road/tram bits when overbuilding stops of the opposite road type [FS#4457] (r21936)
|
||||
- Fix: Allow to overbuild road stops which are built over trams (r21935)
|
||||
- Fix: Automatic orders behave now stable wrt. service orders and are not added or removed depending on the need of servicing [FS#4440] (r21933)
|
||||
- Fix: The town window would not be invalidated in the scenario editor if the ground changed and thus the required cargos for town growth [FS#4554] (r21929)
|
||||
- Fix: Converting an expensive rail type to a cheap one could give more money than removing and rebuilding cost (r21919)
|
||||
- Fix: Languages improperly sorted in the 'start server' window [FS#4443] (r21918)
|
||||
- Fix: the minimum speed needed for (realistic) acceleration to work properly can sometimes be more than the (temporary) maximum speed causing Clamp to 'fail'. Make sure that the minimum speed always overrules the maximum speed [FS#4442] (r21916)
|
||||
- Fix: Include the capacity of non-refittable vehicles in the refitted-capacity, if their cargo matches (r21904)
|
||||
- Fix: Do not count articulated parts when passing the number of vehicles to refit to the command. That may exceed 8 bits (r21902)
|
||||
- Fix: [NoAI] Hide automatic orders from AIs as they have no way of dealing with them (r21900)
|
||||
- Fix: Do not show a vehicle selection in the RefitWindow for refit orders. You cannot select anything anyway (r21899)
|
||||
- Fix: Using a pointer-iterator and adding things (thus reallocating) to the iterated array caused OpenTTD to crash on invalid pointers [FS#4438] (r21898)
|
||||
- Fix: Only some scenarios from the main scenario folder and no heightmaps could be started in the 'start server' window [FS#4421] (r21892)
|
||||
- Fix: Crash when scrolling outside of the main window (with some video backends) [FS#4434] (r21889)
|
||||
- Fix: [NewGRF] String codes 0x80 and 0x81 were broken since the typechecking of string parameters [FS#4422] (r21885)
|
||||
- Fix: When a train after reversing ended at the last bit of a bridge ramp and directed outside the bridge, it could still have track set to TRACK_BIT_WORMHOLE (r21880)
|
||||
- Fix: When a single-vehicle train was reversed while on a slope, its GOINGUP/DOWN were not swapped (r21874)
|
||||
- Remove: Settings for vehicle speed in the vehicle view, long date in status bar, drawing of bridge pillars, support for depot orders, time tabling and joining of stations upon building (r21958, r21957, r21956, r21955, r21954)
|
||||
- Remove: The non-uniform stations setting; it has been broken for over a year, and thus not used [FS#4456] (r21953)
|
||||
|
||||
|
||||
1.1.0-beta4 (2011-01-21)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: [NewGRF] Rail type property to influence sorting of rail types in the drop down list [FS#4394] (r21866)
|
||||
- Feature: [Network] Console command to change the password of other companies for servers [FS#4368] (r21855)
|
||||
- Feature: [NewGRF] Introduction dates/required types for rail types; e.g. introduce a particular rail type in 1960 (or when a vehicle using it is introduced), but also allow limiting its introduction to only happen when the required railtypes are available [FS#4393] (r21842)
|
||||
- Feature: Limit vehicle lateness to the length of a full timetable cycle, e.g. when a cycle takes 50 days and the vehicle is 65 days later reduce the lateness to 15 days (r21832)
|
||||
- Feature: After building a road or tram bridge/tunnel, connect it to any existing road or tram (r21778, r21777)
|
||||
- Feature: Display NewGRF object sprites during object picking (r21772)
|
||||
- Feature: Display NewGRF station sprites during station picking (r21755)
|
||||
- Change: Allow LMB scrolling with the mouse outside of the extra viewport instead of canceling scrolling when going slightly over the edge (r21838)
|
||||
- Change: Only show rail/road types that will eventually be available in-game. For example do not show trams when there is no tram NewGRF loaded (r21817)
|
||||
- Change: Keep aqueducts and road/tram tunnels and bridges after removing a company (r21780)
|
||||
- Fix: Distant-join station would build at the wrong location when having persistent building turned on and selecting a 'second' location for the station tile [FS#4430] (r21864)
|
||||
- Fix: Slowing down of trains was done by reducing the speed by 10%, but also when you are just 1% too fast, so limit the slowdown till the new maximum speed [FS#4423] (r21847)
|
||||
- Fix: Left-mouse-button dragging would switch over to other viewports instead of staying locked to the viewport you started on [FS#4419] (r21837)
|
||||
- Fix: When a train was reversed while inside a tunnel/bridge, it would not have (re)set the GOINGUP/DOWN bits after leaving the tunnel/bridge (r21836)
|
||||
- Fix: Desync debug savegames might not be actually saved in case threading is enabled, which is enabled by default [FS#4427] (r21833)
|
||||
- Fix: Service orders for trains/aircraft would (sometimes) not get a time when autofilling [FS#4414] (r21831)
|
||||
- Fix: Crash with the small map window on big endian platforms [FS#4417] (r21830)
|
||||
- Fix: The expectations from the 'always build infrastructure' setting name/description did not match the behaviour [FS#4007] (r21826)
|
||||
- Fix: Allow dragging of combo signals (again) [FS#4378] (r21816)
|
||||
- Fix: [YAPF] Apply a pathfinder penalty for back of one-way path signals so those arenot preferred over other possibilities [FS#3908] (r21815)
|
||||
- Fix: Check GRF version from action 8, and disallow usage of GRFs with versions above 7 (r21814)
|
||||
- Fix: Crash when displaying the owner view [FS#4411] (r21813)
|
||||
- Fix: Do not create automatic orders when there are no manual orders, and remove unreached automatic orders when reaching an ordered waypoint or depot [FS#4404] (r21809, r21808)
|
||||
- Fix: Loading a TTO savegame failed after loading a TTDP savegame (r21799, r21798)
|
||||
- Fix: The size (in characters) of the string inputs was too small for loading some TTD savegames (r21797)
|
||||
- Fix: Drive through road stop state was not properly converted from TTDPatch savegames [FS#4398] (r21796)
|
||||
- Fix: Broken usage of GetTileOwner() caused wrong conversion of old savegames (r21793)
|
||||
- Fix: Terraforming limit was off-by-one when terraforming a single tile height [FS#4407] (r21791)
|
||||
- Fix: TTDPatch savegames can have train waypoints encoded as buoys [FS#4398] (r21790)
|
||||
- Fix: When the font misses the fallback character '?', use the sprite font's '?' instead [FS#4405] (r21789)
|
||||
- Fix: Crash due to invalid rail station width and height data stored in TTDPatch savegames [FS#4398] (r21786)
|
||||
- Fix: Crash when converting savegame with custom waypoint name (r21784)
|
||||
- Fix: Diagonal tile iterator failed for A * 0 selections [FS#4396] (r21768)
|
||||
- Fix: Do not limit tile clearing during bankruptcy [FS#4397] (r21767)
|
||||
- Fix: PBS reservation was not shown on road crossings with NewGRF railtypes [FS#4369] (r21765)
|
||||
- Remove: The 'stopall' console command, as its functionality was broken. Group start/stop commands can be used instead [FS#4409] (r21804)
|
||||
|
||||
|
||||
1.1.0-beta3 (2011-01-09)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Configurable limit amount of tiles that can be cleared/terraformed by a company [FS#4331] (r21728)
|
||||
@@ -2346,7 +2421,7 @@
|
||||
- Fix: Several desync fixes (incorrect roadstop update of old games, autoreplace bugs) [FS#551] (r8137, r8147, r8157)
|
||||
- Fix: Some disaster-events fixed: combat chopper shoots from right position, submarine once again moves around (r8140, r8158)
|
||||
- Fix: 'out of sprite memory' warning messages due to incorrect assumption of requested memory for sprites (r8133)
|
||||
- Fix: Bouys are now built and numbered 1..9 not 9..1 [FS#538] (r8123)
|
||||
- Fix: Buoys are now built and numbered 1..9 not 9..1 [FS#538] (r8123)
|
||||
- Fix: Clicking for more news properly cycles through the news history backwards, and does not show the first item doubly if it's already open (r8049)
|
||||
- Fix: Crash when removing a town in the scenario editor while the query window is open for one of the town's tiles (r8030)
|
||||
- Fix: Overflow of system-ticks was not handled properly, resulting in a possibly unresponsive server/client (r8028)
|
||||
|
||||
+13
-5
@@ -1,15 +1,24 @@
|
||||
32bpp and OpenTTD
|
||||
=================
|
||||
Last updated: 2007-06-13
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) About
|
||||
2.0) The format
|
||||
|
||||
|
||||
1.0) About
|
||||
---- -----
|
||||
OpenTTD has 32bpp support. This means: OpenTTD still is 8bpp, but it has the
|
||||
posibility to override the graphics with 32bpp. This means that it isn't a
|
||||
replacement of grf or newgrf, but simply an addition. If you want to use 32bpp
|
||||
graphics of a newgrf, you do need the newgrf itself too (with 8bpp graphics).
|
||||
|
||||
|
||||
The Format
|
||||
----------
|
||||
|
||||
2.0) The format
|
||||
---- ----------
|
||||
32bpp images are stored in PNG. They should go in:
|
||||
data/sprites/<grfname>/<SpriteID>.png
|
||||
|
||||
@@ -33,4 +42,3 @@ to add this information. Sadly enough most graphical editors trashes those
|
||||
chunks upon save, so you have to readd it every time you save your image.
|
||||
|
||||
Your images should be the same as the grf, in size.
|
||||
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
STRGEN USAGE
|
||||
------------
|
||||
OpenTTD and strgen
|
||||
Last updated: 2009-06-30
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) strgen usage
|
||||
* 1.1) Examples
|
||||
* 1.2) strgen command switches
|
||||
|
||||
|
||||
1.0) strgen usage
|
||||
---- ------------
|
||||
This guide is only interesting for people who want to alter something
|
||||
themselves without access to translator.openttd.org. Please note that
|
||||
your compiled language file will only be compatible with the OpenTTD version
|
||||
@@ -14,8 +26,8 @@ strgen takes as argument a txt file and translates it to a lng file, allowing
|
||||
it to be used inside OpenTTD. strgen needs the master language file
|
||||
english.txt to work. Below are some examples of strgen usage.
|
||||
|
||||
EXAMPLES
|
||||
--------
|
||||
1.1) Examples
|
||||
---- --------
|
||||
Example 1:
|
||||
if you are in the root of your working copy (svn code), you should type
|
||||
strgen/strgen -s lang lang/english.txt
|
||||
@@ -35,8 +47,8 @@ resulting language file to go to /tmp. Use
|
||||
You can interchange english.txt to whichever language you want to generate a
|
||||
.lng file for.
|
||||
|
||||
STRGEN COMMAND SWITCHES
|
||||
-----------------------
|
||||
1.2) strgen command switches
|
||||
---- -----------------------
|
||||
-v | --version
|
||||
strgen will tell what svn revision it was last modified
|
||||
|
||||
|
||||
+37
-40
@@ -1,19 +1,23 @@
|
||||
Admin Network
|
||||
|
||||
Preface
|
||||
1. Joining the network
|
||||
2. Asking for updates
|
||||
3. Polling manually
|
||||
4. Sending rcon commands
|
||||
5. Sending chat
|
||||
6. Receiving chat
|
||||
7. Disconnecting
|
||||
8. Certain packet information
|
||||
OpenTTD's admin network
|
||||
Last updated: 2011-01-20
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Preface
|
||||
----------
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) Preface
|
||||
2.0) Joining the network
|
||||
3.0) Asking for updates
|
||||
* 3.1) Polling manually
|
||||
4.0) Sending rcon commands
|
||||
5.0) Sending chat
|
||||
* 5.1) Receiving chat
|
||||
6.0) Disconnecting
|
||||
7.0) Certain packet information
|
||||
|
||||
|
||||
1.0) Preface
|
||||
---- -------
|
||||
The admin network provides a dedicated network protocol designed for other
|
||||
applications to communicate with OpenTTD. Connected applications can execute
|
||||
console commands remotely (rcon commands) with no further authentication.
|
||||
@@ -33,12 +37,14 @@ Admin Network
|
||||
removed from packets in later versions, except the possibility that complete
|
||||
packets are dropped in favour of a new packet.
|
||||
This though will be reflected in the protocol version as announced in the
|
||||
ADMIN_PACKET_SERVER_PROTOCOL in section 1.
|
||||
ADMIN_PACKET_SERVER_PROTOCOL in section 2.0).
|
||||
|
||||
A reference implementation in Java for a client connecting to the admin interface
|
||||
can be found at: http://dev.openttdcoop.org/projects/joan
|
||||
|
||||
|
||||
1. Joining the network
|
||||
----------------------
|
||||
|
||||
2.0) Joining the network
|
||||
---- -------------------
|
||||
Create a TCP connection to the server on port 3977. The application is
|
||||
expected to authenticate within 10 seconds.
|
||||
|
||||
@@ -68,9 +74,8 @@ Admin Network
|
||||
However, ADMIN_PACKET_SERVER_WELCOME only after a ADMIN_PACKET_SERVER_NEWGAME
|
||||
|
||||
|
||||
2. Asking for updates
|
||||
---------------------
|
||||
|
||||
3.0) Asking for updates
|
||||
---- ------------------
|
||||
Asking for updates is done with ADMIN_PACKET_ADMIN_UPDATE_FREQUENCY.
|
||||
With this packet you define which update you wish to receive at which
|
||||
frequency.
|
||||
@@ -116,9 +121,8 @@ Admin Network
|
||||
ADMIN_UPDATE_CMD_LOGGING results in the server sending:
|
||||
- ADMIN_PACKET_SERVER_CMD_LOGGING
|
||||
|
||||
3. Polling manually
|
||||
-------------------
|
||||
|
||||
3.1) Polling manually
|
||||
---- ----------------
|
||||
Certain AdminUpdateTypes can also be polled:
|
||||
- ADMIN_UPDATE_DATE
|
||||
- ADMIN_UPDATE_CLIENT_INFO
|
||||
@@ -138,9 +142,8 @@ Admin Network
|
||||
Additional debug information can be found with a debug level of net=3.
|
||||
|
||||
|
||||
4. Sending rcon commands
|
||||
------------------------
|
||||
|
||||
4.0) Sending rcon commands
|
||||
---- ---------------------
|
||||
Rcon runs separate from the ADMIN_UPDATE_CONSOLE AdminUpdateType. Requesting
|
||||
the execution of a remote console command is done with the packet
|
||||
ADMIN_PACKET_ADMIN_RCON.
|
||||
@@ -158,9 +161,8 @@ Admin Network
|
||||
was not sent from the admin network.
|
||||
|
||||
|
||||
5. Sending Chat
|
||||
---------------
|
||||
|
||||
5.0) Sending chat
|
||||
---- ------------
|
||||
Sending a ADMIN_PACKET_ADMIN_CHAT results in chat originating from the server.
|
||||
|
||||
Currently four types of chat are supported:
|
||||
@@ -173,10 +175,8 @@ Admin Network
|
||||
using the respective DestType and ID.
|
||||
This is a message prefixed with the 3 stars, e.g. *** foo has joined the game
|
||||
|
||||
|
||||
6. Receiving chat
|
||||
-----------------
|
||||
|
||||
5.1) Receiving chat
|
||||
---- -------------
|
||||
Register ADMIN_UPDATE_CHAT at ADMIN_FREQUENCY_AUTOMATIC to receive chat.
|
||||
The application will be able to receive all chat the server can see.
|
||||
|
||||
@@ -184,16 +184,14 @@ Admin Network
|
||||
private chat for to the server is distributed into the admin network.
|
||||
|
||||
|
||||
7. Disconnecting
|
||||
----------------
|
||||
|
||||
6.0) Disconnecting
|
||||
---- -------------
|
||||
It is a kind thing to say good bye before leaving. Do this by sending the
|
||||
ADMIN_PACKET_ADMIN_QUIT packet.
|
||||
|
||||
|
||||
8. Certain packet information
|
||||
-----------------------------
|
||||
|
||||
7.0) Certain packet information
|
||||
---- --------------------------
|
||||
All ADMIN_PACKET_SERVER_* packets have an enum value greater 100.
|
||||
|
||||
ADMIN_PACKET_SERVER_WELCOME
|
||||
@@ -211,4 +209,3 @@ Admin Network
|
||||
treated as such. Do not rely on IDs or names to be constant
|
||||
across different versions / revisions of OpenTTD.
|
||||
Data provided in this packet is for logging purposes only.
|
||||
|
||||
|
||||
+68
-22
@@ -1,9 +1,22 @@
|
||||
Multiplayer Manual for OpenTTD
|
||||
==============================
|
||||
Multiplayer manual for OpenTTD
|
||||
Last updated: 2011-01-20
|
||||
------------------------------------------------------------------------
|
||||
|
||||
1. Starting a Server
|
||||
---------------------
|
||||
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) Starting a server
|
||||
2.0) Connecting to a server
|
||||
* 2.1) Connecting to a server over the console
|
||||
3.0) Playing internet games
|
||||
4.0) Tips for servers
|
||||
* 4.1) Imposing landscaping limits
|
||||
5.0) Some useful things
|
||||
6.0) Troubleshooting
|
||||
|
||||
|
||||
1.0) Starting a server
|
||||
---- -----------------
|
||||
- Click "multiplayer" on the startup screen
|
||||
- Click "start server"
|
||||
- Type in a game name
|
||||
@@ -14,9 +27,8 @@ Multiplayer Manual for OpenTTD
|
||||
- Start playing
|
||||
|
||||
|
||||
2. Connecting to a Server
|
||||
--------------------------
|
||||
|
||||
2.0) Connecting to a server
|
||||
---- ----------------------
|
||||
- Click "multiplayer" on the startup screen
|
||||
|
||||
- If you want to connect to any network game in your LAN click on 'LAN', then
|
||||
@@ -43,17 +55,14 @@ Multiplayer Manual for OpenTTD
|
||||
|
||||
- Happy playing
|
||||
|
||||
|
||||
3. Connecting to a Server over the Console
|
||||
-------------------------------------------
|
||||
|
||||
2.1) Connecting to a server over the console
|
||||
---- ---------------------------------------
|
||||
- Open the console and type in the following command:
|
||||
connect <ip/host>:<port>#<company-no>
|
||||
|
||||
|
||||
4. Playing Internet-Games
|
||||
--------------------------
|
||||
|
||||
3.0) Playing internet games
|
||||
---- ----------------------
|
||||
- Servers with a red dot behind it have a different version then you have. You
|
||||
will not be able to join those servers.
|
||||
|
||||
@@ -83,9 +92,8 @@ Multiplayer Manual for OpenTTD
|
||||
NB: changing frame_freq has more effect on the bandwidth then sync_freq.
|
||||
|
||||
|
||||
5. Tips for servers
|
||||
--------------------
|
||||
|
||||
4.0) Tips for servers
|
||||
---- ----------------
|
||||
- You can launch a dedicated server by adding -D as parameter.
|
||||
- In UNIX like systems, you can fork your dedicated server by adding -f as
|
||||
parameter.
|
||||
@@ -141,10 +149,49 @@ Multiplayer Manual for OpenTTD
|
||||
maximum memory usage for packets is:
|
||||
#max_clients * #max_clients * bytes_per_frame * 10 KiB.
|
||||
|
||||
4.1) Imposing landscaping limits
|
||||
---- ---------------------------
|
||||
- You can impose limits on companies by the following 4 settings:
|
||||
- terraform_per_64k_frames
|
||||
- terraform_frame_burst
|
||||
- clear_per_64k_frames
|
||||
- clear_frame_burst
|
||||
|
||||
6. Some useful things
|
||||
----------------------
|
||||
- Explaining 'per_64K_frames' and 'burst'
|
||||
- 'burst' defines 3 things, the maximum limit, the limit of a single action,
|
||||
and the initial value for the limit assigned to a new company.
|
||||
This setting is fairly simple and requires no math.
|
||||
|
||||
A value of 1 means a single tile can be affected by a single action.
|
||||
This results in having to click 400 times when wanting to cover an area
|
||||
of 20 x 20 tiles.
|
||||
|
||||
The default value 4096 covers an area of 64 x 64 tiles.
|
||||
|
||||
- 'per_64k_frames' defines the number of tiles added to each companies limit
|
||||
per frame (however not past the possible maximum value,the 'burst').
|
||||
64k rather resembles the exact number of 65536 frames. So setting this
|
||||
variable to 65536 means: 65536 / 65536 = 1 tile per frame.
|
||||
As a day consists of 74 frames, a company's limit is increased by 74
|
||||
tiles during the course of a single day (2.22 seconds).
|
||||
|
||||
To achieve a 1 tile per day increase the following calculation is needed:
|
||||
1 / 74 (frames per day) * 65536 (per_64k_frames) = 885.62...
|
||||
after rounding: a value of 886 means adding a bit over 1 tile per day.
|
||||
|
||||
There is still enough space to scale this value downwards:
|
||||
decreasing this value to 127 results in a bit over 1 tile added to the
|
||||
allowance per week (7 days).
|
||||
|
||||
To create a setup in which a company gets an initial allowance only,
|
||||
set the value to 0 - no increase of the allowance per frame.
|
||||
|
||||
- Even though construction actions include a clear tile action, they are not
|
||||
affected by the above settings.
|
||||
|
||||
|
||||
5.0) Some useful things
|
||||
---- ------------------
|
||||
- You can protect your company so nobody else can join uninvited. To do this,
|
||||
set a password in your Company Screen
|
||||
|
||||
@@ -156,9 +203,8 @@ Multiplayer Manual for OpenTTD
|
||||
- Servers can now kick players, so don't make them use it!
|
||||
|
||||
|
||||
7. Troubleshooting
|
||||
------------------
|
||||
|
||||
6.0) Troubleshooting
|
||||
---- ---------------
|
||||
- My advertising server does not show up in list at servers.openttd.org
|
||||
Run openttd with the '-d net=2' parameter, as this will show whether it
|
||||
receives replies from the master server. If it does not receive replies it
|
||||
|
||||
+17
-3
@@ -93,12 +93,17 @@ elif [ -d "$ROOT_DIR/.git" ]; then
|
||||
fi
|
||||
HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`
|
||||
REV="g`echo $HASH | cut -c1-8`"
|
||||
BRANCH=`git symbolic-ref -q HEAD 2>/dev/null | sed 's@.*/@@;s@^master$@@'`
|
||||
BRANCH="`git symbolic-ref -q HEAD 2>/dev/null | sed 's@.*/@@;s@^master$@@'`"
|
||||
REV_NR=`LC_ALL=C git log --pretty=format:%s --grep="^(svn r[0-9]*)" -1 | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
|
||||
if [ -z "$REV_NR" ]; then
|
||||
# No rev? Maybe it is a custom git-svn clone
|
||||
REV_NR=`LC_ALL=C git log --pretty=format:%b --grep="git-svn-id:.*@[0-9]*" -1 | sed "s@.*\@\([0-9]*\).*@\1@"`
|
||||
fi
|
||||
TAG="`git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null`"
|
||||
if [ -n "$TAG" ]; then
|
||||
BRANCH=""
|
||||
REV="$TAG"
|
||||
fi
|
||||
elif [ -d "$ROOT_DIR/.hg" ]; then
|
||||
# We are a hg checkout
|
||||
if [ -n "`hg status | grep -v '^?'`" ]; then
|
||||
@@ -106,8 +111,17 @@ elif [ -d "$ROOT_DIR/.hg" ]; then
|
||||
fi
|
||||
HASH=`LC_ALL=C hg id -i | cut -c1-12`
|
||||
REV="h`echo $HASH | cut -c1-8`"
|
||||
BRANCH=`hg branch | sed 's@^default$@@'`
|
||||
REV_NR=`LC_ALL=C hg log -f -k "(svn r" -l 1 --template "{desc}\n" | head -n 1 | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
|
||||
BRANCH="`hg branch | sed 's@^default$@@'`"
|
||||
TAG="`hg id -t | grep -v 'tip$'`"
|
||||
if [ -n "$TAG" ]; then
|
||||
BRANCH=""
|
||||
REV="$TAG"
|
||||
fi
|
||||
REV_NR=`LC_ALL=C hg log -f -k "(svn r" -l 1 --template "{desc|firstline}\n" | grep "^(svn r[0-9]*)" | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
|
||||
if [ -z "$REV_NR" ]; then
|
||||
# No rev? Maybe it is a custom hgsubversion clone
|
||||
REV_NR=`LC_ALL=C hg parent --template="{svnrev}"`
|
||||
fi
|
||||
elif [ -f "$ROOT_DIR/.ottdrev" ]; then
|
||||
# We are an exported source bundle
|
||||
cat $ROOT_DIR/.ottdrev
|
||||
|
||||
+40
-15
@@ -1,18 +1,18 @@
|
||||
OpenTTD's known bugs
|
||||
Last updated: 2010-01-09
|
||||
Release version: 1.1.0-beta3
|
||||
Last updated: 2011-02-04
|
||||
Release version: 1.1.0-beta5
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Table of Contents:
|
||||
------------------
|
||||
1) About
|
||||
2) Known bugs in this release
|
||||
3) Known bugs that will not be solved
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) About
|
||||
2.0) Known bugs in this release
|
||||
* 2.1) Known bugs that will not be solved
|
||||
|
||||
|
||||
1) About:
|
||||
-- ------
|
||||
1.0) About
|
||||
---- -----
|
||||
All bugs listed below are marked as known. Please do not submit any bugs
|
||||
that are the same as these. If you do, do not act surprised, because
|
||||
we WILL flame you!!
|
||||
@@ -22,8 +22,8 @@ specifics, we welcome you to report them. React to the given bug indicated
|
||||
by the number below on http://bugs.openttd.org.
|
||||
|
||||
|
||||
2) Known bugs in this release:
|
||||
-- ---------------------------
|
||||
2.0) Known bugs in this release
|
||||
---- --------------------------
|
||||
The following bugs are known to exist in this release and we intend to
|
||||
fix them. Some bugs are known but are not fixable or fixing them would
|
||||
cause further problems. Those bugs can be found in the "Known bugs that
|
||||
@@ -39,13 +39,11 @@ officially supporting Mac OS X again. For now it remains unsupported and
|
||||
we only apply bug fixes provided by the community but we are unable to fix
|
||||
these bugs ourselves.
|
||||
|
||||
- 3569 Location of wagons can be outside of the wagon
|
||||
- 3447 [OSX] SDL port is unuseable
|
||||
- 2484 [OSX] Cannot enter CJK characters
|
||||
|
||||
|
||||
3) Known bugs that will not be solved:
|
||||
-- -----------------------------------
|
||||
2.1) Known bugs that will not be solved
|
||||
---- ----------------------------------
|
||||
This section lists all known bugs that we do not intend to fix and the
|
||||
reasons why we think that fixing them is infeasible. We might make some
|
||||
minor improvements that reduce the scope of these bugs, but we will not
|
||||
@@ -259,3 +257,30 @@ OpenTTD hangs when started on 32 bits Windows [FS#4083]
|
||||
The reason we do not use the "win32" music driver as default are
|
||||
described in the "Long delay between switching music/song" section
|
||||
of this document.
|
||||
|
||||
Pre- and exit signals are not dragged [FS#4378]
|
||||
Unlike all other signal types, the entry- and exit signals are not
|
||||
dragged but instead normal signals are placed on subsequent track
|
||||
sections. This is done on purpose as this is the usually more con-
|
||||
venient solution. There are little to no occasions where more than
|
||||
one entry or exit signal in a row are useful. This is different
|
||||
for all other signal types where several in a row can serve one
|
||||
purpose or another.
|
||||
|
||||
Station build date is incorrect [FS#4415]
|
||||
The tile query tool will show the date of the last (re)construction
|
||||
at the station and not the date of the first construction. This is
|
||||
due to compatability reasons with NewGRFs and the fact that it is
|
||||
wrong to say that the station is built in a particular year when it
|
||||
was completely destroyed/rebuilt later on.
|
||||
The tile query tool can be fixed by changing the "Build date" text
|
||||
to "Date at which the last (re)construction took place" but this is
|
||||
deemed too specific and long for that window.
|
||||
|
||||
Can't change volume inside OpenTTD [FS#4416]
|
||||
Some backends do not provide a means to change the volume of sound
|
||||
effects or music. The mixing of music and sound is left to external
|
||||
libraries/the operating system we can't handle the volume control
|
||||
in OpenTTD. As a result you can't change the volume inside OpenTTD
|
||||
for backends such as SDL; just use the volume control provided by
|
||||
your operating system.
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
openttd (1.1.0~beta5) unstable; urgency=low
|
||||
|
||||
* New upstream release 1.1.0-beta5
|
||||
|
||||
-- Matthijs Kooijman <matthijs@stdin.nl> Fri, 04 Feb 2011 22:00:00 +0100
|
||||
|
||||
openttd (1.1.0~beta4) unstable; urgency=low
|
||||
|
||||
* New upstream release 1.1.0-beta4
|
||||
|
||||
-- Matthijs Kooijman <matthijs@stdin.nl> Fri, 21 Jan 2011 00:00:00 +0100
|
||||
|
||||
openttd (1.1.0~beta3) unstable; urgency=low
|
||||
|
||||
* New upstream release 1.1.0-beta3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
|
||||
set OPENTTD_VERSION=1.1.0-beta3
|
||||
set OPENTTD_VERSION=1.1.0-beta5
|
||||
set OPENSFX_VERSION=0.8.0
|
||||
set NOSOUND_VERSION=0.8.0
|
||||
set OPENGFX_VERSION=0.7.0
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
!define APPV_MAJOR 1
|
||||
!define APPV_MINOR 1
|
||||
!define APPV_MAINT 0
|
||||
!define APPV_BUILD 2
|
||||
!define APPV_EXTRA "-beta3"
|
||||
!define APPV_BUILD 4
|
||||
!define APPV_EXTRA "-beta5"
|
||||
|
||||
!define APPNAME "OpenTTD" ; Define application name
|
||||
!define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version
|
||||
|
||||
@@ -201,7 +201,7 @@ Function DetermineSVNVersion()
|
||||
End If ' line <> "master"
|
||||
End If ' Err.Number = 0
|
||||
|
||||
Set oExec = WshShell.Exec("git log --pretty=format:%s --grep=" & Chr(34) & "^(svn r[0-9]*)" & Chr(34) & " -1 ../")
|
||||
Set oExec = WshShell.Exec("git log --pretty=format:%s --grep=" & Chr(34) & "^(svn r[0-9]*)" & Chr(34) & " -1")
|
||||
if Err.Number = 0 Then
|
||||
revision = Mid(oExec.StdOut.ReadLine(), 7)
|
||||
revision = Mid(revision, 1, InStr(revision, ")") - 1)
|
||||
@@ -210,13 +210,26 @@ Function DetermineSVNVersion()
|
||||
' No revision? Maybe it is a custom git-svn clone
|
||||
' Reset error number as WshShell.Exec will not do that on success
|
||||
Err.Clear
|
||||
Set oExec = WshShell.Exec("git log --pretty=format:%b --grep=" & Chr(34) & "git-svn-id:.*@[0-9]*" & Chr(34) & " -1 ../")
|
||||
Set oExec = WshShell.Exec("git log --pretty=format:%b --grep=" & Chr(34) & "git-svn-id:.*@[0-9]*" & Chr(34) & " -1")
|
||||
If Err.Number = 0 Then
|
||||
revision = oExec.StdOut.ReadLine()
|
||||
revision = Mid(revision, InStr(revision, "@") + 1)
|
||||
revision = Mid(revision, 1, InStr(revision, " ") - 1)
|
||||
End If ' Err.Number = 0
|
||||
End If ' revision = ""
|
||||
|
||||
' Check if a tag is currently checked out
|
||||
Err.Clear
|
||||
Set oExec = WshShell.Exec("git name-rev --name-only --tags --no-undefined HEAD")
|
||||
If Err.Number = 0 Then
|
||||
' Wait till the application is finished ...
|
||||
Do While oExec.Status = 0
|
||||
Loop
|
||||
If oExec.ExitCode = 0 Then
|
||||
version = oExec.StdOut.ReadLine()
|
||||
branch = ""
|
||||
End If ' oExec.ExitCode = 0
|
||||
End If ' Err.Number = 0
|
||||
End If ' Err.Number = 0
|
||||
End If ' oExec.ExitCode = 0
|
||||
End If ' Err.Number = 0
|
||||
@@ -224,7 +237,7 @@ Function DetermineSVNVersion()
|
||||
If version = "norev000" Then
|
||||
' git detection failed, reset error and try mercurial (hg)
|
||||
Err.Clear
|
||||
Set oExec = WshShell.Exec("hg parents")
|
||||
Set oExec = WshShell.Exec("hg id -i")
|
||||
If Err.Number = 0 Then
|
||||
' Wait till the application is finished ...
|
||||
Do While oExec.Status = 0
|
||||
@@ -232,8 +245,21 @@ Function DetermineSVNVersion()
|
||||
|
||||
If oExec.ExitCode = 0 Then
|
||||
line = OExec.StdOut.ReadLine()
|
||||
hash = Mid(line, InStrRev(line, ":") + 1)
|
||||
hash = Left(line, 12)
|
||||
version = "h" & Mid(hash, 1, 8)
|
||||
|
||||
' Check if a tag is currently checked out
|
||||
Err.Clear
|
||||
Set oExec = WshShell.Exec("hg id -t")
|
||||
If Err.Number = 0 Then
|
||||
line = oExec.StdOut.ReadLine()
|
||||
If Len(line) > 0 And Right(line, 3) <> "tip" Then
|
||||
version = line
|
||||
branch = ""
|
||||
End If ' Len(line) > 0 And Right(line, 3) <> "tip"
|
||||
End If ' Err.Number = 0
|
||||
|
||||
Err.Clear
|
||||
Set oExec = WshShell.Exec("hg status ../")
|
||||
If Err.Number = 0 Then
|
||||
Do
|
||||
@@ -252,11 +278,23 @@ Function DetermineSVNVersion()
|
||||
End If ' line <> "default"
|
||||
End If ' Err.Number = 0
|
||||
|
||||
Set oExec = WshShell.Exec("hg log -f -k " & Chr(34) & "(svn r" & Chr(34) & " -l 1 --template " & Chr(34) & "{desc}\n" & Chr(34) & " --cwd ../")
|
||||
Set oExec = WshShell.Exec("hg log -f -k " & Chr(34) & "(svn r" & Chr(34) & " -l 1 --template " & Chr(34) & "{desc|firstline}\n" & Chr(34) & " --cwd ../")
|
||||
If Err.Number = 0 Then
|
||||
revision = Mid(OExec.StdOut.ReadLine(), 7)
|
||||
revision = Mid(revision, 1, InStr(revision, ")") - 1)
|
||||
line = oExec.StdOut.ReadLine()
|
||||
If Left(line, 6) = "(svn r" Then
|
||||
revision = Mid(line, 7)
|
||||
revision = Mid(revision, 1, InStr(revision, ")") - 1)
|
||||
End If 'Left(line, 6) = "(svn r"
|
||||
End If ' Err.Number = 0
|
||||
|
||||
If revision = "" Then
|
||||
' No rev? Maybe it is a custom hgsubversion clone
|
||||
Err.Clear
|
||||
Set oExec = WshShell.Exec("hg parent --template=" & Chr(34) & "{svnrev}" & Chr(34))
|
||||
If Err.Number = 0 Then
|
||||
revision = oExec.StdOut.ReadLine()
|
||||
End If ' Err.Number = 0
|
||||
End If ' revision = ""
|
||||
End If ' Err.Number = 0
|
||||
End If ' oExec.ExitCode = 0
|
||||
End If ' Err.Number = 0
|
||||
|
||||
+54
-58
@@ -1,34 +1,35 @@
|
||||
OpenTTD README
|
||||
Last updated: 2011-01-09
|
||||
Release version: 1.1.0-beta3
|
||||
OpenTTD readme
|
||||
Last updated: 2011-02-04
|
||||
Release version: 1.1.0-beta5
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Table of Contents:
|
||||
------------------
|
||||
Table of contents
|
||||
-----------------
|
||||
1.0) About
|
||||
2.0) Contacting
|
||||
* 2.1 Reporting Bugs
|
||||
* 2.2 Reporting Desyncs
|
||||
3.0) Supported Platforms
|
||||
* 2.1) Reporting bugs
|
||||
* 2.2) Reporting desyncs
|
||||
3.0) Supported platforms
|
||||
4.0) Installing and running OpenTTD
|
||||
* 4.1 (Required) 3rd party files
|
||||
* 4.2 OpenTTD directories
|
||||
* 4.3 Portable Installations (External Media)
|
||||
* 4.1) (Required) 3rd party files
|
||||
* 4.2) OpenTTD directories
|
||||
* 4.3) Portable installations (portable media)
|
||||
5.0) OpenTTD features
|
||||
6.0) Configuration File
|
||||
* 5.1) Logging of potentially dangerous actions
|
||||
6.0) Configuration file
|
||||
7.0) Compiling
|
||||
* 7.1) Required/optional libraries
|
||||
* 7.2) Supported compilers
|
||||
8.0) Translating
|
||||
* 8.1 Translation
|
||||
* 8.2 Previewing
|
||||
* 8.1) Translation
|
||||
* 8.2) Previewing
|
||||
9.0) Troubleshooting
|
||||
X.X) Credits
|
||||
|
||||
|
||||
1.0) About:
|
||||
---- ------
|
||||
1.0) About
|
||||
---- -----
|
||||
OpenTTD is a transport simulation game based upon the popular game Transport
|
||||
Tycoon Deluxe, written by Chris Sawyer. It attempts to mimic the original
|
||||
game as closely as possible while extending it with new features.
|
||||
@@ -36,7 +37,8 @@ game as closely as possible while extending it with new features.
|
||||
OpenTTD is licensed under the GNU General Public License version 2.0. For
|
||||
more information, see the file 'COPYING'.
|
||||
|
||||
2.0) Contacting:
|
||||
|
||||
2.0) Contacting
|
||||
---- ----------
|
||||
The easiest way to contact the OpenTTD team is by submitting bug reports or
|
||||
posting comments in our forums. You can also chat with us on IRC (#openttd
|
||||
@@ -47,9 +49,8 @@ The OpenTTD homepage is http://www.openttd.org/.
|
||||
You can also find the OpenTTD forums at
|
||||
http://forum.openttd.org/
|
||||
|
||||
|
||||
2.1) Reporting Bugs:
|
||||
---- ---------------
|
||||
2.1) Reporting bugs
|
||||
---- --------------
|
||||
First of all, check whether the bug is not already known. Do this by looking
|
||||
through the file called 'known-bugs.txt' which is distributed with OpenTTD
|
||||
like this readme.
|
||||
@@ -87,8 +88,8 @@ following information in your bug report:
|
||||
* Attach crash.dmp, crash.log and crash.sav. These files are usually created
|
||||
next to your openttd.cfg. The crash handler will tell you the location.
|
||||
|
||||
2.2) Reporting Desyncs:
|
||||
---- ------------------
|
||||
2.2) Reporting desyncs
|
||||
---- -----------------
|
||||
As desyncs are hard to make reproducible OpenTTD has the ability to log all
|
||||
actions done by clients so we can replay the whole game in an effort to make
|
||||
desyncs better reproducible. You need to turn this ability on. When turned
|
||||
@@ -140,8 +141,9 @@ Do NOT remove the dmp_cmds savegames of a desync you have reported until the
|
||||
desync has been fixed; if you, by accident, send us the wrong savegames we
|
||||
will not be able to reproduce the desync and thus will be unable to fix it.
|
||||
|
||||
3.0) Supported Platforms:
|
||||
---- --------------------
|
||||
|
||||
3.0) Supported platforms
|
||||
---- -------------------
|
||||
OpenTTD has been ported to several platforms and operating systems. It shouldn't
|
||||
be very difficult to port it to a new platform. The currently working platforms
|
||||
are:
|
||||
@@ -157,9 +159,8 @@ are:
|
||||
Windows - Win32 GDI (faster) or SDL or Allegro
|
||||
|
||||
|
||||
4.0) Installing and running OpenTTD:
|
||||
---- -------------------------------
|
||||
|
||||
4.0) Installing and running OpenTTD
|
||||
---- ------------------------------
|
||||
Installing OpenTTD is fairly straightforward. Either you have downloaded an
|
||||
archive which you have to extract to a directory where you want OpenTTD to
|
||||
be installed, or you have downloaded an installer, which will automatically
|
||||
@@ -186,9 +187,8 @@ automatically selected (and downloaded) if you get the AIs via the "Check
|
||||
Online Content". If you do not have an AI but have configured OpenTTD to start
|
||||
an AI a message will be shown that the 'dummy' AI has been started.
|
||||
|
||||
4.1) (Required) 3rd party files:
|
||||
---- ---------------------------
|
||||
|
||||
4.1) (Required) 3rd party files
|
||||
---- --------------------------
|
||||
Before you run OpenTTD, you need to put the game's data files into a data/
|
||||
directory which can be located in various places addressed in the following
|
||||
section.
|
||||
@@ -248,8 +248,7 @@ wait for an error message to pop up. The error message will tell you
|
||||
"couldn't find library 'lib-name'". Download that library and try again.
|
||||
|
||||
4.2) OpenTTD directories
|
||||
---- -------------------------------
|
||||
|
||||
---- -------------------
|
||||
The required 3rd party files listed in the section 4.1 "(Required) 3rd party files"
|
||||
as well as other non-compulsory extensions (NewGRFs, AI, heightmaps, scenarios) can be
|
||||
placed in a few different locations:
|
||||
@@ -289,10 +288,8 @@ Place 3rd party files in shared directory (or in personal directory if you don't
|
||||
have write access on shared directory) and have your openttd.cfg config file in
|
||||
personal directory (where the game will then also place savegames and screenshots).
|
||||
|
||||
|
||||
4.3) Portable Installations (External Media):
|
||||
---- ----------------------------------------
|
||||
|
||||
4.3) Portable installations (portable media)
|
||||
---- ---------------------------------------
|
||||
You can install OpenTTD on external media so you can take it with you, i.e.
|
||||
using a USB key, or a USB HDD, etc.
|
||||
Create a directory where you shall store the game in (i.e. OpenTTD/).
|
||||
@@ -305,9 +302,8 @@ As always - additional grf files are stored in the data/ dir (for details,
|
||||
again, see section 4.1).
|
||||
|
||||
|
||||
5.0) OpenTTD features:
|
||||
---- -----------------
|
||||
|
||||
5.0) OpenTTD features
|
||||
---- ----------------
|
||||
OpenTTD has a lot of features going beyond the original Transport Tycoon Deluxe
|
||||
emulation. Unfortunately, there is currently no comprehensive list of features,
|
||||
but there is a basic features list on the web, and some optional features can be
|
||||
@@ -326,10 +322,8 @@ Several important non-standard controls:
|
||||
* Hovering over a GUI element shows tooltips. This can be changed to right click
|
||||
via the advanced settings.
|
||||
|
||||
|
||||
5.1) Logging of potentially dangerous actions:
|
||||
5.1) Logging of potentially dangerous actions
|
||||
---- ----------------------------------------
|
||||
|
||||
OpenTTD is a complex program, and together with NewGRF, it may show a buggy
|
||||
behaviour. But not only bugs in code can cause problems. There are several
|
||||
ways to affect game state possibly resulting in program crash or multiplayer
|
||||
@@ -358,8 +352,8 @@ You can show the game log by typing 'gamelog' in the console or by running
|
||||
OpenTTD in debug mode.
|
||||
|
||||
|
||||
6.0) Configuration File:
|
||||
---- -------------------
|
||||
6.0) Configuration file
|
||||
---- ------------------
|
||||
The configuration file for OpenTTD (openttd.cfg) is in a simple Windows-like
|
||||
.INI format. It's mostly undocumented. Almost all settings can be changed
|
||||
ingame by using the 'Advanced Settings' window.
|
||||
@@ -368,8 +362,8 @@ described in section 4.2. If you do not have an openttd.cfg OpenTTD will
|
||||
create one after closing.
|
||||
|
||||
|
||||
7.0) Compiling:
|
||||
---- ----------
|
||||
7.0) Compiling
|
||||
---- ---------
|
||||
Windows:
|
||||
You need Microsoft Visual Studio .NET. Open the project file
|
||||
and it should build automatically. In case you want to build with SDL support
|
||||
@@ -421,8 +415,8 @@ DOS:
|
||||
will be generated that does not need cwsdpmi.exe by adding the cswdstub.exe
|
||||
to the created OpenTTD binary.
|
||||
|
||||
7.1) Required/optional libraries:
|
||||
---- -------------------
|
||||
7.1) Required/optional libraries
|
||||
---- ---------------------------
|
||||
The following libraries are used by OpenTTD for:
|
||||
- libSDL/liballegro: hardware access (video, sound, mouse)
|
||||
- zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads, heightmaps
|
||||
@@ -446,7 +440,7 @@ GRFCodec can be found at: http://www.openttd.org/download-grfcodec
|
||||
The compilation of these extra graphics does generally not happen, unless
|
||||
you remove the graphics file using "make maintainer-clean".
|
||||
|
||||
7.2) Supported compilers:
|
||||
7.2) Supported compilers
|
||||
---- -------------------
|
||||
The following compilers are known to compile OpenTTD:
|
||||
- Microsoft Visual C++ (MSVC) 2005, 2008 and 2010.
|
||||
@@ -470,8 +464,9 @@ The following compilers are known not to compile OpenTTD:
|
||||
If any of these compilers can compile OpenTTD again, please let us know.
|
||||
Patches to support more compilers are welcome.
|
||||
|
||||
8.0) Translating:
|
||||
---- -------------------
|
||||
|
||||
8.0) Translating
|
||||
---- -----------
|
||||
See http://www.openttd.org/development for up-to-date information.
|
||||
|
||||
The use of the online Translator service, located at
|
||||
@@ -485,8 +480,8 @@ Please contact the translations manager (http://www.openttd.org/contact)
|
||||
before beginning the translation process! This avoids double work, as
|
||||
someone else may have already started translating to the same language.
|
||||
|
||||
8.1) Translation:
|
||||
---- -------------------
|
||||
8.1) Translation
|
||||
---- -----------
|
||||
So, now that you've notified the development team about your intention to
|
||||
translate (You did, right? Of course you did.) you can pick up english.txt
|
||||
(found in the SVN repository under /src/lang) and translate.
|
||||
@@ -503,8 +498,8 @@ Note: Do not alter the following parts of the file:
|
||||
* Lines beginning with ## (such as ##id), other than the first two lines of
|
||||
the file
|
||||
|
||||
8.2) Previewing:
|
||||
---- -------------------
|
||||
8.2) Previewing
|
||||
---- ----------
|
||||
In order to view the translation in the game, you need to compile your language
|
||||
file with the strgen utility. You can download the precompiled strgen from:
|
||||
http://www.openttd.org/download-strgen
|
||||
@@ -523,9 +518,9 @@ should also be.
|
||||
|
||||
That's all! You should now be able to select the language in the game options.
|
||||
|
||||
|
||||
9.0) Troubleshooting
|
||||
---- ---------------
|
||||
|
||||
To see all startup options available to you, start OpenTTD with the
|
||||
"./openttd -h" option. This might help you tweak some of the settings.
|
||||
|
||||
@@ -558,8 +553,9 @@ will be output to the console at the moment, so use the '-d' flag (on windows)
|
||||
to see this list. You just have to find the files (http://grfcrawler.tt-forums.net/)
|
||||
put them in the data/ folder and you're set to go.
|
||||
|
||||
X.X) Credits:
|
||||
---- --------
|
||||
|
||||
X.X) Credits
|
||||
---- -------
|
||||
The OpenTTD team (in alphabetical order):
|
||||
Albert Hofkamp (Alberth) - GUI expert
|
||||
Jean-François Claeys (Belugas) - GUI, newindustries and more
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
/** @file ai_config.cpp Implementation of AIConfig. */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../openttd.h"
|
||||
#include "../settings_type.h"
|
||||
#include "../core/random_func.hpp"
|
||||
#include "ai.hpp"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
/** @file ai_gui.cpp Window for configuring the AIs */
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../openttd.h"
|
||||
#include "../table/sprites.h"
|
||||
#include "../gui.h"
|
||||
#include "../querystring_gui.h"
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "ai_info.hpp"
|
||||
#include "ai_scanner.hpp"
|
||||
#include "../settings_type.h"
|
||||
#include "../openttd.h"
|
||||
#include "../debug.h"
|
||||
#include "../rev.h"
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
#include "api/ai_waypointlist.hpp.sq"
|
||||
|
||||
#include "../company_base.h"
|
||||
#include "../company_func.h"
|
||||
#include "../fileio_func.h"
|
||||
|
||||
/** The maximum number of operations for saving or loading the data of an AI. */
|
||||
|
||||
@@ -12,11 +12,8 @@
|
||||
#ifndef AI_SCANNER_HPP
|
||||
#define AI_SCANNER_HPP
|
||||
|
||||
#include <squirrel.h>
|
||||
#include "../script/script_scanner.hpp"
|
||||
#include "../core/string_compare_type.hpp"
|
||||
#include "ai.hpp"
|
||||
#include <map>
|
||||
|
||||
/**
|
||||
* Class that scans for available AIs.
|
||||
|
||||
@@ -12,12 +12,7 @@
|
||||
#ifndef AI_STORAGE_HPP
|
||||
#define AI_STORAGE_HPP
|
||||
|
||||
#include "../command_func.h"
|
||||
#include "../map_func.h"
|
||||
#include "../network/network.h"
|
||||
#include "../company_func.h"
|
||||
#include "../signs_func.h"
|
||||
#include "../tunnelbridge.h"
|
||||
#include "../vehicle_func.h"
|
||||
#include "../road_type.h"
|
||||
#include "../group.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_accounting.cpp Implementation of AIAccounting. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_accounting.hpp"
|
||||
|
||||
Money AIAccounting::GetCosts()
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_airport.cpp Implementation of AIAirport. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_airport.hpp"
|
||||
#include "ai_station.hpp"
|
||||
#include "../../station_base.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_base.cpp Implementation of AIBase. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_base.hpp"
|
||||
#include "../../network/network.h"
|
||||
#include "../../core/random_func.hpp"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_basestation.cpp Implementation of AIBaseStation. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_basestation.hpp"
|
||||
#include "../../station_base.h"
|
||||
#include "../../string_func.h"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_BASESTATION_HPP
|
||||
#define AI_BASESTATION_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_error.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_bridge.cpp Implementation of AIBridge. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_bridge.hpp"
|
||||
#include "ai_rail.hpp"
|
||||
#include "../ai_instance.hpp"
|
||||
@@ -151,9 +152,7 @@ static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
|
||||
{
|
||||
if (!IsValidBridge(bridge_id)) return -1;
|
||||
|
||||
uint max = ::GetBridgeSpec(bridge_id)->max_length;
|
||||
if (max >= MAX_BRIDGE_LENGTH && _settings_game.construction.longbridges) max = MAX_BRIDGE_LENGTH_LONGBRIDGES;
|
||||
return max + 2;
|
||||
return min(::GetBridgeSpec(bridge_id)->max_length, _settings_game.construction.max_bridge_length) + 2;
|
||||
}
|
||||
|
||||
/* static */ int32 AIBridge::GetMinLength(BridgeID bridge_id)
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
#ifndef AI_BRIDGE_HPP
|
||||
#define AI_BRIDGE_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_vehicle.hpp"
|
||||
#include "ai_error.hpp"
|
||||
|
||||
/**
|
||||
* Class that handles all bridge related functions.
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_bridgelist.cpp Implementation of AIBridgeList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_bridgelist.hpp"
|
||||
#include "ai_bridge.hpp"
|
||||
#include "../../bridge.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_cargo.cpp Implementation of AICargo. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_cargo.hpp"
|
||||
#include "../../cargotype.h"
|
||||
#include "../../economy_func.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_cargolist.cpp Implementation of AICargoList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_cargolist.hpp"
|
||||
#include "ai_industry.hpp"
|
||||
#include "../../cargotype.h"
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* \li HasNext for all lists.
|
||||
* \li AIAbstractList, use AIList instead.
|
||||
* \li AIList::ChangeItem, use AIList::SetValue instead.
|
||||
* \li AIRail::ERR_NONUNIFORM_STATIONS_DISABLED, that error is never returned anymore.
|
||||
*
|
||||
* Other changes:
|
||||
* \li AIEngine::GetMaxTractiveEffort can be used for road vehicles.
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_company.cpp Implementation of AICompany. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_company.hpp"
|
||||
#include "ai_error.hpp"
|
||||
#include "../../command_func.h"
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
#include "../../stdafx.h"
|
||||
#include "../../string_func.h"
|
||||
#include "../../company_base.h"
|
||||
#include "../../company_func.h"
|
||||
#include "../../rev.h"
|
||||
|
||||
#include "ai_controller.hpp"
|
||||
#include "../ai_storage.hpp"
|
||||
#include "../ai_instance.hpp"
|
||||
#include "../ai_config.hpp"
|
||||
#include "ai_log.hpp"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_date.cpp Implementation of AIDate. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_date.hpp"
|
||||
#include "../../date_func.h"
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_depotlist.cpp Implementation of AIDepotList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_depotlist.hpp"
|
||||
#include "../../company_func.h"
|
||||
#include "../../depot_base.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_engine.cpp Implementation of AIEngine. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_engine.hpp"
|
||||
#include "ai_cargo.hpp"
|
||||
#include "../../company_func.h"
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
#ifndef AI_ENGINE_HPP
|
||||
#define AI_ENGINE_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_vehicle.hpp"
|
||||
#include "ai_road.hpp"
|
||||
#include "ai_rail.hpp"
|
||||
#include "ai_airport.hpp"
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_enginelist.cpp Implementation of AIEngineList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_enginelist.hpp"
|
||||
#include "../../company_func.h"
|
||||
#include "../../engine_base.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_error.cpp Implementation of AIError. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_error.hpp"
|
||||
#include "../../core/bitmath_func.hpp"
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_event.cpp Implementation of AIEvent. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_event_types.hpp"
|
||||
|
||||
#include <queue>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_event_types.cpp Implementation of all EventTypes. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_event_types.hpp"
|
||||
#include "ai_vehicle.hpp"
|
||||
#include "../../command_type.h"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_EVENT_TYPES_HPP
|
||||
#define AI_EVENT_TYPES_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_event.hpp"
|
||||
#include "ai_company.hpp"
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_execmode.cpp Implementation of AIExecMode. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_execmode.hpp"
|
||||
#include "../../company_base.h"
|
||||
#include "../../company_func.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_gamesettings.cpp Implementation of AIGameSettings. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_gamesettings.hpp"
|
||||
#include "../../settings_internal.h"
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_GAMESETTINGS_HPP
|
||||
#define AI_GAMESETTINGS_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_vehicle.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_group.cpp Implementation of AIGroup. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_group.hpp"
|
||||
#include "ai_engine.hpp"
|
||||
#include "../ai_instance.hpp"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_GROUP_HPP
|
||||
#define AI_GROUP_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_vehicle.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_grouplist.cpp Implementation of AIGroupList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_grouplist.hpp"
|
||||
#include "../../company_func.h"
|
||||
#include "../../group.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_industry.cpp Implementation of AIIndustry. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_industry.hpp"
|
||||
#include "ai_cargo.hpp"
|
||||
#include "ai_map.hpp"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_industrylist.cpp Implementation of AIIndustryList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_industrylist.hpp"
|
||||
#include "../../industry.h"
|
||||
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
|
||||
/** @file ai_industrytype.cpp Implementation of AIIndustryType. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_industrytype.hpp"
|
||||
#include "ai_map.hpp"
|
||||
#include "ai_error.hpp"
|
||||
#include "../../strings_func.h"
|
||||
#include "../../industry.h"
|
||||
#include "../../newgrf_industries.h"
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef AI_INDUSTRYTYPE_HPP
|
||||
#define AI_INDUSTRYTYPE_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_error.hpp"
|
||||
#include "ai_list.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_industrytypelist.cpp Implementation of AIIndustryTypeList. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_industrytypelist.hpp"
|
||||
#include "../../industry.h"
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_INDUSTRYTYPELIST_HPP
|
||||
#define AI_INDUSTRYTYPELIST_HPP
|
||||
|
||||
#include "ai_list.hpp"
|
||||
#include "ai_industrytype.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_list.cpp Implementation of AIList. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_list.hpp"
|
||||
#include "../../debug.h"
|
||||
#include "../../script/squirrel.hpp"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_log.cpp Implementation of AILog. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_log.hpp"
|
||||
#include "../../core/alloc_func.hpp"
|
||||
#include "../../company_func.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_map.cpp Implementation of AIMap. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_map.hpp"
|
||||
#include "../../tile_map.h"
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_marine.cpp Implementation of AIMarine. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_marine.hpp"
|
||||
#include "ai_station.hpp"
|
||||
#include "../../station_base.h"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_MARINE_HPP
|
||||
#define AI_MARINE_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_error.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,11 @@
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "../../script/squirrel.hpp"
|
||||
#include "../../command_func.h"
|
||||
#include "../../company_base.h"
|
||||
#include "../../company_func.h"
|
||||
#include "../../network/network.h"
|
||||
#include "../../tunnelbridge.h"
|
||||
|
||||
#include "../ai_storage.hpp"
|
||||
#include "../ai_instance.hpp"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_OBJECT_HPP
|
||||
#define AI_OBJECT_HPP
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "../../misc/countedptr.hpp"
|
||||
#include "../../road_type.h"
|
||||
#include "../../rail_type.h"
|
||||
|
||||
+29
-10
@@ -9,6 +9,8 @@
|
||||
|
||||
/** @file ai_order.cpp Implementation of AIOrder. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_order.hpp"
|
||||
#include "ai_vehicle.hpp"
|
||||
#include "../ai_instance.hpp"
|
||||
#include "../../debug.h"
|
||||
@@ -46,7 +48,7 @@ static OrderType GetOrderTypeByTile(TileIndex t)
|
||||
|
||||
/* static */ bool AIOrder::IsValidVehicleOrder(VehicleID vehicle_id, OrderPosition order_position)
|
||||
{
|
||||
return AIVehicle::IsValidVehicle(vehicle_id) && order_position >= 0 && (order_position < ::Vehicle::Get(vehicle_id)->GetNumOrders() || order_position == ORDER_CURRENT);
|
||||
return AIVehicle::IsValidVehicle(vehicle_id) && order_position >= 0 && (order_position < ::Vehicle::Get(vehicle_id)->GetNumManualOrders() || order_position == ORDER_CURRENT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,7 +65,14 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
order_position = AIOrder::ResolveOrderPosition(vehicle_id, order_position);
|
||||
if (order_position == AIOrder::ORDER_INVALID) return NULL;
|
||||
}
|
||||
return v->GetOrder(order_position);
|
||||
const Order *order = v->orders.list->GetFirstOrder();
|
||||
while (order->GetType() == OT_AUTOMATIC) order = order->next;
|
||||
while (order_position > 0) {
|
||||
order_position = (AIOrder::OrderPosition)(order_position - 1);
|
||||
order = order->next;
|
||||
while (order->GetType() == OT_AUTOMATIC) order = order->next;
|
||||
}
|
||||
return order;
|
||||
}
|
||||
|
||||
/* static */ bool AIOrder::IsGotoStationOrder(VehicleID vehicle_id, OrderPosition order_position)
|
||||
@@ -122,8 +131,18 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
{
|
||||
if (!AIVehicle::IsValidVehicle(vehicle_id)) return ORDER_INVALID;
|
||||
|
||||
if (order_position == ORDER_CURRENT) return (AIOrder::OrderPosition)::Vehicle::Get(vehicle_id)->cur_order_index;
|
||||
return (order_position >= 0 && order_position < ::Vehicle::Get(vehicle_id)->GetNumOrders()) ? order_position : ORDER_INVALID;
|
||||
if (order_position == ORDER_CURRENT) {
|
||||
int cur_order_pos = ::Vehicle::Get(vehicle_id)->cur_real_order_index;
|
||||
const Order *order = ::Vehicle::Get(vehicle_id)->GetOrder(0);
|
||||
if (order == NULL) return ORDER_INVALID;
|
||||
int num_automatic_orders = 0;
|
||||
for (int i = 0; i < cur_order_pos; i++) {
|
||||
if (order->GetType() == OT_AUTOMATIC) num_automatic_orders++;
|
||||
order = order->next;
|
||||
}
|
||||
return (AIOrder::OrderPosition)(cur_order_pos - num_automatic_orders);
|
||||
}
|
||||
return (order_position >= 0 && order_position < ::Vehicle::Get(vehicle_id)->GetNumManualOrders()) ? order_position : ORDER_INVALID;
|
||||
}
|
||||
|
||||
|
||||
@@ -260,7 +279,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
if (!IsValidVehicleOrder(vehicle_id, order_position)) return ORDER_INVALID;
|
||||
if (order_position == ORDER_CURRENT || !IsConditionalOrder(vehicle_id, order_position)) return ORDER_INVALID;
|
||||
|
||||
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
|
||||
const Order *order = ::ResolveOrder(vehicle_id, order_position);
|
||||
return (OrderPosition)order->GetConditionSkipToOrder();
|
||||
}
|
||||
|
||||
@@ -269,7 +288,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
if (!IsValidVehicleOrder(vehicle_id, order_position)) return OC_INVALID;
|
||||
if (order_position == ORDER_CURRENT || !IsConditionalOrder(vehicle_id, order_position)) return OC_INVALID;
|
||||
|
||||
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
|
||||
const Order *order = ::ResolveOrder(vehicle_id, order_position);
|
||||
return (OrderCondition)order->GetConditionVariable();
|
||||
}
|
||||
|
||||
@@ -278,7 +297,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
if (!IsValidVehicleOrder(vehicle_id, order_position)) return CF_INVALID;
|
||||
if (order_position == ORDER_CURRENT || !IsConditionalOrder(vehicle_id, order_position)) return CF_INVALID;
|
||||
|
||||
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
|
||||
const Order *order = ::ResolveOrder(vehicle_id, order_position);
|
||||
return (CompareFunction)order->GetConditionComparator();
|
||||
}
|
||||
|
||||
@@ -287,7 +306,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
if (!IsValidVehicleOrder(vehicle_id, order_position)) return -1;
|
||||
if (order_position == ORDER_CURRENT || !IsConditionalOrder(vehicle_id, order_position)) return -1;
|
||||
|
||||
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
|
||||
const Order *order = ::ResolveOrder(vehicle_id, order_position);
|
||||
int32 value = order->GetConditionValue();
|
||||
if (order->GetConditionVariable() == OCV_MAX_SPEED) value = value * 16 / 10;
|
||||
return value;
|
||||
@@ -299,7 +318,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
|
||||
if (AIVehicle::GetVehicleType(vehicle_id) != AIVehicle::VT_RAIL) return STOPLOCATION_INVALID;
|
||||
if (!IsGotoStationOrder(vehicle_id, order_position)) return STOPLOCATION_INVALID;
|
||||
|
||||
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
|
||||
const Order *order = ::ResolveOrder(vehicle_id, order_position);
|
||||
return (AIOrder::StopLocation)order->GetStopLocation();
|
||||
}
|
||||
|
||||
@@ -486,7 +505,7 @@ static void _DoCommandReturnSetOrderFlags(class AIInstance *instance)
|
||||
EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position));
|
||||
EnforcePrecondition(false, AreOrderFlagsValid(GetOrderDestination(vehicle_id, order_position), order_flags));
|
||||
|
||||
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
|
||||
const Order *order = ::ResolveOrder(vehicle_id, order_position);
|
||||
|
||||
AIOrderFlags current = GetOrderFlags(vehicle_id, order_position);
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_ORDER_HPP
|
||||
#define AI_ORDER_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_error.hpp"
|
||||
|
||||
/**
|
||||
@@ -113,7 +112,13 @@ public:
|
||||
CF_INVALID = -1, ///< Invalid compare function, do not use.
|
||||
};
|
||||
|
||||
/** Different constants related to the OrderPosition */
|
||||
/**
|
||||
* Index in the list of orders for a vehicle. The first order has index 0, the second
|
||||
* order index 1, etc. The current order can be queried by using ORDER_CURRENT. Do not
|
||||
* use ORDER_INVALID yourself, it's used as return value by for example ResolveOrderPosition.
|
||||
* @note Automatic orders are hidden from AIs, so OrderPosition 0 will always be the first
|
||||
* manual order.
|
||||
*/
|
||||
enum OrderPosition {
|
||||
ORDER_CURRENT = 0xFF, ///< Constant that gets resolved to the current order.
|
||||
ORDER_INVALID = -1, ///< An invalid order.
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_rail.cpp Implementation of AIRail. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_rail.hpp"
|
||||
#include "ai_map.hpp"
|
||||
#include "ai_station.hpp"
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef AI_RAIL_HPP
|
||||
#define AI_RAIL_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_error.hpp"
|
||||
#include "ai_tile.hpp"
|
||||
|
||||
/**
|
||||
@@ -37,9 +35,6 @@ public:
|
||||
/** Track not suitable for signals */
|
||||
ERR_UNSUITABLE_TRACK, // [STR_ERROR_NO_SUITABLE_RAILROAD_TRACK]
|
||||
|
||||
/** Non-uniform stations is diabled */
|
||||
ERR_NONUNIFORM_STATIONS_DISABLED, // [STR_ERROR_NONUNIFORM_STATIONS_DISALLOWED]
|
||||
|
||||
/** This railtype cannot have crossings */
|
||||
ERR_RAILTYPE_DISALLOWS_CROSSING, // [STR_ERROR_CROSSING_DISALLOWED]
|
||||
};
|
||||
|
||||
+35
-38
@@ -38,46 +38,43 @@ void SQAIRail_Register(Squirrel *engine)
|
||||
SQAIRail.PreRegister(engine);
|
||||
SQAIRail.AddConstructor<void (AIRail::*)(), 1>(engine, "x");
|
||||
|
||||
SQAIRail.DefSQConst(engine, AIRail::ERR_RAIL_BASE, "ERR_RAIL_BASE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::ERR_CROSSING_ON_ONEWAY_ROAD, "ERR_CROSSING_ON_ONEWAY_ROAD");
|
||||
SQAIRail.DefSQConst(engine, AIRail::ERR_UNSUITABLE_TRACK, "ERR_UNSUITABLE_TRACK");
|
||||
SQAIRail.DefSQConst(engine, AIRail::ERR_NONUNIFORM_STATIONS_DISABLED, "ERR_NONUNIFORM_STATIONS_DISABLED");
|
||||
SQAIRail.DefSQConst(engine, AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING, "ERR_RAILTYPE_DISALLOWS_CROSSING");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTYPE_INVALID, "RAILTYPE_INVALID");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NE_SW, "RAILTRACK_NE_SW");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NW_SE, "RAILTRACK_NW_SE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NW_NE, "RAILTRACK_NW_NE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_SW_SE, "RAILTRACK_SW_SE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NW_SW, "RAILTRACK_NW_SW");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NE_SE, "RAILTRACK_NE_SE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_INVALID, "RAILTRACK_INVALID");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_NORMAL, "SIGNALTYPE_NORMAL");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_ENTRY, "SIGNALTYPE_ENTRY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_EXIT, "SIGNALTYPE_EXIT");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_COMBO, "SIGNALTYPE_COMBO");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_PBS, "SIGNALTYPE_PBS");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_PBS_ONEWAY, "SIGNALTYPE_PBS_ONEWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_TWOWAY, "SIGNALTYPE_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_NORMAL_TWOWAY, "SIGNALTYPE_NORMAL_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_ENTRY_TWOWAY, "SIGNALTYPE_ENTRY_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_EXIT_TWOWAY, "SIGNALTYPE_EXIT_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_COMBO_TWOWAY, "SIGNALTYPE_COMBO_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_NONE, "SIGNALTYPE_NONE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_TRACK, "BT_TRACK");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_SIGNAL, "BT_SIGNAL");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_DEPOT, "BT_DEPOT");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_STATION, "BT_STATION");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_WAYPOINT, "BT_WAYPOINT");
|
||||
SQAIRail.DefSQConst(engine, AIRail::ERR_RAIL_BASE, "ERR_RAIL_BASE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::ERR_CROSSING_ON_ONEWAY_ROAD, "ERR_CROSSING_ON_ONEWAY_ROAD");
|
||||
SQAIRail.DefSQConst(engine, AIRail::ERR_UNSUITABLE_TRACK, "ERR_UNSUITABLE_TRACK");
|
||||
SQAIRail.DefSQConst(engine, AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING, "ERR_RAILTYPE_DISALLOWS_CROSSING");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTYPE_INVALID, "RAILTYPE_INVALID");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NE_SW, "RAILTRACK_NE_SW");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NW_SE, "RAILTRACK_NW_SE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NW_NE, "RAILTRACK_NW_NE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_SW_SE, "RAILTRACK_SW_SE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NW_SW, "RAILTRACK_NW_SW");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NE_SE, "RAILTRACK_NE_SE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_INVALID, "RAILTRACK_INVALID");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_NORMAL, "SIGNALTYPE_NORMAL");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_ENTRY, "SIGNALTYPE_ENTRY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_EXIT, "SIGNALTYPE_EXIT");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_COMBO, "SIGNALTYPE_COMBO");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_PBS, "SIGNALTYPE_PBS");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_PBS_ONEWAY, "SIGNALTYPE_PBS_ONEWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_TWOWAY, "SIGNALTYPE_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_NORMAL_TWOWAY, "SIGNALTYPE_NORMAL_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_ENTRY_TWOWAY, "SIGNALTYPE_ENTRY_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_EXIT_TWOWAY, "SIGNALTYPE_EXIT_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_COMBO_TWOWAY, "SIGNALTYPE_COMBO_TWOWAY");
|
||||
SQAIRail.DefSQConst(engine, AIRail::SIGNALTYPE_NONE, "SIGNALTYPE_NONE");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_TRACK, "BT_TRACK");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_SIGNAL, "BT_SIGNAL");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_DEPOT, "BT_DEPOT");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_STATION, "BT_STATION");
|
||||
SQAIRail.DefSQConst(engine, AIRail::BT_WAYPOINT, "BT_WAYPOINT");
|
||||
|
||||
AIError::RegisterErrorMap(STR_ERROR_CROSSING_ON_ONEWAY_ROAD, AIRail::ERR_CROSSING_ON_ONEWAY_ROAD);
|
||||
AIError::RegisterErrorMap(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK, AIRail::ERR_UNSUITABLE_TRACK);
|
||||
AIError::RegisterErrorMap(STR_ERROR_NONUNIFORM_STATIONS_DISALLOWED, AIRail::ERR_NONUNIFORM_STATIONS_DISABLED);
|
||||
AIError::RegisterErrorMap(STR_ERROR_CROSSING_DISALLOWED, AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING);
|
||||
AIError::RegisterErrorMap(STR_ERROR_CROSSING_ON_ONEWAY_ROAD, AIRail::ERR_CROSSING_ON_ONEWAY_ROAD);
|
||||
AIError::RegisterErrorMap(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK, AIRail::ERR_UNSUITABLE_TRACK);
|
||||
AIError::RegisterErrorMap(STR_ERROR_CROSSING_DISALLOWED, AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING);
|
||||
|
||||
AIError::RegisterErrorMapString(AIRail::ERR_CROSSING_ON_ONEWAY_ROAD, "ERR_CROSSING_ON_ONEWAY_ROAD");
|
||||
AIError::RegisterErrorMapString(AIRail::ERR_UNSUITABLE_TRACK, "ERR_UNSUITABLE_TRACK");
|
||||
AIError::RegisterErrorMapString(AIRail::ERR_NONUNIFORM_STATIONS_DISABLED, "ERR_NONUNIFORM_STATIONS_DISABLED");
|
||||
AIError::RegisterErrorMapString(AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING, "ERR_RAILTYPE_DISALLOWS_CROSSING");
|
||||
AIError::RegisterErrorMapString(AIRail::ERR_CROSSING_ON_ONEWAY_ROAD, "ERR_CROSSING_ON_ONEWAY_ROAD");
|
||||
AIError::RegisterErrorMapString(AIRail::ERR_UNSUITABLE_TRACK, "ERR_UNSUITABLE_TRACK");
|
||||
AIError::RegisterErrorMapString(AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING, "ERR_RAILTYPE_DISALLOWS_CROSSING");
|
||||
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::GetName, "GetName", 2, ".i");
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::IsRailTile, "IsRailTile", 2, ".i");
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_railtypelist.cpp Implementation of AIRailTypeList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_railtypelist.hpp"
|
||||
#include "../../rail.h"
|
||||
#include "../../company_func.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_road.cpp Implementation of AIRoad. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_map.hpp"
|
||||
#include "ai_station.hpp"
|
||||
#include "ai_cargo.hpp"
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef AI_ROAD_HPP
|
||||
#define AI_ROAD_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_error.hpp"
|
||||
#include "ai_tile.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_sign.cpp Implementation of AISign. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_sign.hpp"
|
||||
#include "table/strings.h"
|
||||
#include "../ai_instance.hpp"
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
#ifndef AI_SIGN_HPP
|
||||
#define AI_SIGN_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_error.hpp"
|
||||
#include "ai_company.hpp"
|
||||
|
||||
/**
|
||||
* Class that handles all sign related functions.
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_signlist.cpp Implementation of AISignList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_signlist.hpp"
|
||||
#include "ai_sign.hpp"
|
||||
#include "../../signs_base.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_station.cpp Implementation of AIStation. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_station.hpp"
|
||||
#include "ai_cargo.hpp"
|
||||
#include "ai_map.hpp"
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef AI_STATION_HPP
|
||||
#define AI_STATION_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_error.hpp"
|
||||
#include "ai_road.hpp"
|
||||
#include "ai_basestation.hpp"
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_stationlist.cpp Implementation of AIStationList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_stationlist.hpp"
|
||||
#include "ai_vehicle.hpp"
|
||||
#include "../../company_func.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_subsidy.cpp Implementation of AISubsidy. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_subsidy.hpp"
|
||||
#include "ai_date.hpp"
|
||||
#include "../../subsidy_base.h"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_SUBSIDY_HPP
|
||||
#define AI_SUBSIDY_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_company.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_subsidylist.cpp Implementation of AISubsidyList. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_subsidylist.hpp"
|
||||
#include "../../subsidy_base.h"
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_testmode.cpp Implementation of AITestMode. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_testmode.hpp"
|
||||
#include "../../company_base.h"
|
||||
#include "../../company_func.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_tile.cpp Implementation of AITile. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_tile.hpp"
|
||||
#include "ai_map.hpp"
|
||||
#include "ai_town.hpp"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_TILE_HPP
|
||||
#define AI_TILE_HPP
|
||||
|
||||
#include "ai_list.hpp"
|
||||
#include "ai_error.hpp"
|
||||
#include "ai_company.hpp"
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_tilelist.cpp Implementation of AITileList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_tilelist.hpp"
|
||||
#include "ai_industry.hpp"
|
||||
#include "../../industry.h"
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#ifndef AI_TILELIST_HPP
|
||||
#define AI_TILELIST_HPP
|
||||
|
||||
#include "ai_list.hpp"
|
||||
#include "ai_station.hpp"
|
||||
#include "ai_list.hpp"
|
||||
|
||||
/**
|
||||
* Creates an empty list, in which you can add tiles.
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_town.cpp Implementation of AITown. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_town.hpp"
|
||||
#include "ai_map.hpp"
|
||||
#include "ai_cargo.hpp"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_TOWN_HPP
|
||||
#define AI_TOWN_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_company.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_townlist.cpp Implementation of AITownList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_townlist.hpp"
|
||||
#include "../../town.h"
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_tunnel.cpp Implementation of AITunnel. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_tunnel.hpp"
|
||||
#include "ai_rail.hpp"
|
||||
#include "../ai_instance.hpp"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef AI_TUNNEL_HPP
|
||||
#define AI_TUNNEL_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_vehicle.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_vehicle.cpp Implementation of AIVehicle. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_engine.hpp"
|
||||
#include "ai_cargo.hpp"
|
||||
#include "ai_gamesettings.hpp"
|
||||
|
||||
@@ -12,10 +12,7 @@
|
||||
#ifndef AI_VEHICLE_HPP
|
||||
#define AI_VEHICLE_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_error.hpp"
|
||||
#include "ai_road.hpp"
|
||||
#include "ai_order.hpp"
|
||||
|
||||
/**
|
||||
* Class that handles all vehicle related functions.
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_vehiclelist.cpp Implementation of AIVehicleList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_vehiclelist.hpp"
|
||||
#include "ai_group.hpp"
|
||||
#include "ai_map.hpp"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_waypoint.cpp Implementation of AIWaypoint. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_waypoint.hpp"
|
||||
#include "ai_rail.hpp"
|
||||
#include "ai_marine.hpp"
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef AI_WAYPOINT_HPP
|
||||
#define AI_WAYPOINT_HPP
|
||||
|
||||
#include "ai_object.hpp"
|
||||
#include "ai_error.hpp"
|
||||
#include "ai_basestation.hpp"
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
/** @file ai_waypointlist.cpp Implementation of AIWaypointList and friends. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "ai_waypointlist.hpp"
|
||||
#include "ai_vehicle.hpp"
|
||||
#include "../../company_func.h"
|
||||
|
||||
+1
-24
@@ -26,31 +26,9 @@ enum AircraftSubType {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Handle Aircraft specific tasks when an Aircraft enters a hangar
|
||||
* @param *v Vehicle that enters the hangar
|
||||
*/
|
||||
void HandleAircraftEnterHangar(Aircraft *v);
|
||||
|
||||
/**
|
||||
* Get the size of the sprite of an aircraft sprite heading west (used for lists)
|
||||
* @param engine The engine to get the sprite from
|
||||
* @param width The width of the sprite
|
||||
* @param height The height of the sprite
|
||||
*/
|
||||
void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height);
|
||||
|
||||
/**
|
||||
* Updates the status of the Aircraft heading or in the station
|
||||
* @param st Station been updated
|
||||
*/
|
||||
void UpdateAirplanesOnNewStation(const Station *st);
|
||||
|
||||
/**
|
||||
* Update cached values of an aircraft.
|
||||
* Currently caches callback 36 max speed.
|
||||
* @param v Vehicle
|
||||
*/
|
||||
void UpdateAircraftCache(Aircraft *v);
|
||||
|
||||
void AircraftLeaveHangar(Aircraft *v);
|
||||
@@ -72,11 +50,10 @@ struct Aircraft : public SpecializedVehicle<Aircraft, VEH_AIRCRAFT> {
|
||||
byte turn_counter; ///< Ticks between each turn to prevent > 45 degree turns.
|
||||
|
||||
/** We don't want GCC to zero our struct! It already is zeroed and has an index! */
|
||||
Aircraft() : SpecializedVehicle<Aircraft, VEH_AIRCRAFT>() {}
|
||||
Aircraft() : SpecializedVehicleBase() {}
|
||||
/** We want to 'destruct' the right class. */
|
||||
virtual ~Aircraft() { this->PreDestructor(); }
|
||||
|
||||
const char *GetTypeString() const { return "aircraft"; }
|
||||
void MarkDirty();
|
||||
void UpdateDeltaXY(Direction direction);
|
||||
ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_AIRCRAFT_INC : EXPENSES_AIRCRAFT_RUN; }
|
||||
|
||||
@@ -533,6 +533,11 @@ static void PlayAircraftSound(const Vehicle *v)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update cached values of an aircraft.
|
||||
* Currently caches callback 36 max speed.
|
||||
* @param v Vehicle
|
||||
*/
|
||||
void UpdateAircraftCache(Aircraft *v)
|
||||
{
|
||||
uint max_speed = GetVehicleProperty(v, PROP_AIRCRAFT_SPEED, 0);
|
||||
@@ -600,9 +605,7 @@ static int UpdateAircraftSpeed(Aircraft *v, uint speed_limit = SPEED_LIMIT_NONE,
|
||||
/* updates statusbar only if speed have changed to save CPU time */
|
||||
if (spd != v->cur_speed) {
|
||||
v->cur_speed = spd;
|
||||
if (_settings_client.gui.vehicle_speed) {
|
||||
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
}
|
||||
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
}
|
||||
|
||||
/* Adjust distance moved by plane speed setting */
|
||||
@@ -1664,7 +1667,7 @@ static bool AirportSetBlocks(Aircraft *v, const AirportFTA *current_pos, const A
|
||||
break;
|
||||
}
|
||||
current = current->next;
|
||||
};
|
||||
}
|
||||
|
||||
/* if the block to be checked is in the next position, then exclude that from
|
||||
* checking, because it has been set by the airplane before */
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ AirportFTAClass::~AirportFTAClass()
|
||||
AirportFTA *next = current->next;
|
||||
free(current);
|
||||
current = next;
|
||||
};
|
||||
}
|
||||
}
|
||||
free(layout);
|
||||
}
|
||||
|
||||
+1
-1
@@ -551,7 +551,7 @@ static const NWidgetPart _nested_build_airport_widgets[] = {
|
||||
NWidget(NWID_VSCROLLBAR, COLOUR_GREY, BAIRW_SCROLLBAR),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, BAIRW_LAYOUT_DECREASE), SetMinimalSize(12, 0),SetDataTip(AWV_DECREASE, STR_NULL),
|
||||
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, BAIRW_LAYOUT_DECREASE), SetMinimalSize(12, 0), SetDataTip(AWV_DECREASE, STR_NULL),
|
||||
NWidget(WWT_LABEL, COLOUR_GREY, BAIRW_LAYOUT_NUM), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_BLACK_STRING, STR_NULL),
|
||||
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, BAIRW_LAYOUT_INCREASE), SetMinimalSize(12, 0), SetDataTip(AWV_INCREASE, STR_NULL),
|
||||
EndContainer(),
|
||||
|
||||
@@ -28,7 +28,7 @@ static const uint MAX_ARTICULATED_PARTS = 100; ///< Maximum of articulated parts
|
||||
* @param mirrored Returns whether the part shall be flipped.
|
||||
* @return engine to add or INVALID_ENGINE
|
||||
*/
|
||||
static EngineID GetNextArticPart(uint index, EngineID front_type, Vehicle *front = NULL, bool *mirrored = NULL)
|
||||
static EngineID GetNextArticulatedPart(uint index, EngineID front_type, Vehicle *front = NULL, bool *mirrored = NULL)
|
||||
{
|
||||
assert(front == NULL || front->engine_type == front_type);
|
||||
|
||||
@@ -55,7 +55,7 @@ uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
|
||||
|
||||
uint i;
|
||||
for (i = 1; i < MAX_ARTICULATED_PARTS; i++) {
|
||||
if (GetNextArticPart(i, engine_type, v) == INVALID_ENGINE) break;
|
||||
if (GetNextArticulatedPart(i, engine_type, v) == INVALID_ENGINE) break;
|
||||
}
|
||||
|
||||
delete v;
|
||||
@@ -113,7 +113,7 @@ CargoArray GetCapacityOfArticulatedParts(EngineID engine)
|
||||
if (!HasBit(e->info.callback_mask, CBM_VEHICLE_ARTIC_ENGINE)) return capacity;
|
||||
|
||||
for (uint i = 1; i < MAX_ARTICULATED_PARTS; i++) {
|
||||
EngineID artic_engine = GetNextArticPart(i, engine);
|
||||
EngineID artic_engine = GetNextArticulatedPart(i, engine);
|
||||
if (artic_engine == INVALID_ENGINE) break;
|
||||
|
||||
cargo_capacity = GetVehicleDefaultCapacity(artic_engine, &cargo_type);
|
||||
@@ -138,7 +138,7 @@ bool IsArticulatedVehicleRefittable(EngineID engine)
|
||||
if (!HasBit(e->info.callback_mask, CBM_VEHICLE_ARTIC_ENGINE)) return false;
|
||||
|
||||
for (uint i = 1; i < MAX_ARTICULATED_PARTS; i++) {
|
||||
EngineID artic_engine = GetNextArticPart(i, engine);
|
||||
EngineID artic_engine = GetNextArticulatedPart(i, engine);
|
||||
if (artic_engine == INVALID_ENGINE) break;
|
||||
|
||||
if (IsEngineRefittable(artic_engine)) return true;
|
||||
@@ -165,7 +165,7 @@ void GetArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type,
|
||||
if (!HasBit(e->info.callback_mask, CBM_VEHICLE_ARTIC_ENGINE)) return;
|
||||
|
||||
for (uint i = 1; i < MAX_ARTICULATED_PARTS; i++) {
|
||||
EngineID artic_engine = GetNextArticPart(i, engine);
|
||||
EngineID artic_engine = GetNextArticulatedPart(i, engine);
|
||||
if (artic_engine == INVALID_ENGINE) break;
|
||||
|
||||
veh_cargos = GetAvailableVehicleCargoTypes(artic_engine, include_initial_cargo_type);
|
||||
@@ -221,19 +221,7 @@ bool IsArticulatedVehicleCarryingDifferentCargos(const Vehicle *v, CargoID *carg
|
||||
}
|
||||
}
|
||||
|
||||
switch (v->type) {
|
||||
case VEH_TRAIN:
|
||||
v = Train::From(v)->HasArticulatedPart() ? Train::From(v)->GetNextArticPart() : NULL;
|
||||
break;
|
||||
|
||||
case VEH_ROAD:
|
||||
v = RoadVehicle::From(v)->HasArticulatedPart() ? v->Next() : NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
v = NULL;
|
||||
break;
|
||||
}
|
||||
v = v->HasArticulatedPart() ? v->GetNextArticulatedPart() : NULL;
|
||||
} while (v != NULL);
|
||||
|
||||
if (cargo_type != NULL) *cargo_type = first_cargo;
|
||||
@@ -268,19 +256,7 @@ void CheckConsistencyOfArticulatedVehicle(const Vehicle *v)
|
||||
assert(v->cargo_type < NUM_CARGO);
|
||||
real_default_capacity[v->cargo_type] += v->cargo_cap;
|
||||
|
||||
switch (v->type) {
|
||||
case VEH_TRAIN:
|
||||
v = Train::From(v)->HasArticulatedPart() ? Train::From(v)->GetNextArticPart() : NULL;
|
||||
break;
|
||||
|
||||
case VEH_ROAD:
|
||||
v = RoadVehicle::From(v)->HasArticulatedPart() ? v->Next() : NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
v = NULL;
|
||||
break;
|
||||
}
|
||||
v = v->HasArticulatedPart() ? v->GetNextArticulatedPart() : NULL;
|
||||
} while (v != NULL);
|
||||
|
||||
/* Check whether the vehicle carries more cargos than expected */
|
||||
@@ -306,7 +282,7 @@ void AddArticulatedParts(Vehicle *first)
|
||||
Vehicle *v = first;
|
||||
for (uint i = 1; i < MAX_ARTICULATED_PARTS; i++) {
|
||||
bool flip_image;
|
||||
EngineID engine_type = GetNextArticPart(i, first->engine_type, first, &flip_image);
|
||||
EngineID engine_type = GetNextArticulatedPart(i, first->engine_type, first, &flip_image);
|
||||
if (engine_type == INVALID_ENGINE) return;
|
||||
|
||||
/* In the (very rare) case the GRF reported wrong number of articulated parts
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user