mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-13 01:29:10 +00:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
59a291c66b |
@@ -213,11 +213,10 @@ function Regression::Airport()
|
||||
print(" GetAirportType(): " + AIAirport.GetAirportType(32116));
|
||||
|
||||
for (local i = -1; i < 10; i++) {
|
||||
print(" IsAirportInformationAvailable(" + i + "): " + AIAirport.IsAirportInformationAvailable(i));
|
||||
print(" IsValidAirportType(" + i + "): " + AIAirport.IsValidAirportType(i));
|
||||
print(" GetAirportWidth(" + i + "): " + AIAirport.GetAirportWidth(i));
|
||||
print(" GetAirportHeight(" + i + "): " + AIAirport.GetAirportHeight(i));
|
||||
print(" GetAirportCoverageRadius(" + i + "): " + AIAirport.GetAirportCoverageRadius(i));
|
||||
print(" IsValidAirportType(" + i + "): " + AIAirport.IsValidAirportType(i));
|
||||
print(" GetAirportWidth(" + i + "): " + AIAirport.GetAirportWidth(i));
|
||||
print(" GetAirportHeight(" + i + "): " + AIAirport.GetAirportHeight(i));
|
||||
print(" GetAirportCoverageRadius(" + i + "): " + AIAirport.GetAirportCoverageRadius(i));
|
||||
}
|
||||
|
||||
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
|
||||
|
@@ -575,61 +575,50 @@
|
||||
IsAirportTile(): false
|
||||
GetHangarOfAirport(): -1
|
||||
GetAirportType(): 255
|
||||
IsAirportInformationAvailable(-1): false
|
||||
IsValidAirportType(-1): false
|
||||
GetAirportWidth(-1): -1
|
||||
GetAirportHeight(-1): -1
|
||||
GetAirportCoverageRadius(-1): -1
|
||||
IsAirportInformationAvailable(0): true
|
||||
IsValidAirportType(0): true
|
||||
GetAirportWidth(0): 4
|
||||
GetAirportHeight(0): 3
|
||||
GetAirportCoverageRadius(0): 4
|
||||
IsAirportInformationAvailable(1): true
|
||||
IsValidAirportType(1): false
|
||||
GetAirportWidth(1): 6
|
||||
GetAirportHeight(1): 6
|
||||
GetAirportCoverageRadius(1): 5
|
||||
IsAirportInformationAvailable(2): true
|
||||
IsValidAirportType(2): false
|
||||
GetAirportWidth(2): 1
|
||||
GetAirportHeight(2): 1
|
||||
GetAirportCoverageRadius(2): 4
|
||||
IsAirportInformationAvailable(3): true
|
||||
IsValidAirportType(3): false
|
||||
GetAirportWidth(3): 6
|
||||
GetAirportHeight(3): 6
|
||||
GetAirportCoverageRadius(3): 6
|
||||
IsAirportInformationAvailable(4): true
|
||||
IsValidAirportType(4): false
|
||||
GetAirportWidth(4): 7
|
||||
GetAirportHeight(4): 7
|
||||
GetAirportCoverageRadius(4): 8
|
||||
IsAirportInformationAvailable(5): true
|
||||
IsValidAirportType(5): false
|
||||
GetAirportWidth(5): 5
|
||||
GetAirportHeight(5): 4
|
||||
GetAirportCoverageRadius(5): 4
|
||||
IsAirportInformationAvailable(6): true
|
||||
IsValidAirportType(6): false
|
||||
GetAirportWidth(6): 2
|
||||
GetAirportHeight(6): 2
|
||||
GetAirportCoverageRadius(6): 4
|
||||
IsAirportInformationAvailable(7): true
|
||||
IsValidAirportType(7): false
|
||||
GetAirportWidth(7): 9
|
||||
GetAirportHeight(7): 11
|
||||
GetAirportCoverageRadius(7): 10
|
||||
IsAirportInformationAvailable(8): true
|
||||
IsValidAirportType(8): false
|
||||
GetAirportWidth(8): 4
|
||||
GetAirportHeight(8): 2
|
||||
GetAirportCoverageRadius(8): 4
|
||||
IsAirportInformationAvailable(9): false
|
||||
IsValidAirportType(9): false
|
||||
GetAirportWidth(9): -1
|
||||
GetAirportHeight(9): -1
|
||||
GetAirportCoverageRadius(9): -1
|
||||
IsValidAirportType(-1): false
|
||||
GetAirportWidth(-1): -1
|
||||
GetAirportHeight(-1): -1
|
||||
GetAirportCoverageRadius(-1): -1
|
||||
IsValidAirportType(0): true
|
||||
GetAirportWidth(0): 4
|
||||
GetAirportHeight(0): 3
|
||||
GetAirportCoverageRadius(0): 4
|
||||
IsValidAirportType(1): false
|
||||
GetAirportWidth(1): -1
|
||||
GetAirportHeight(1): -1
|
||||
GetAirportCoverageRadius(1): -1
|
||||
IsValidAirportType(2): false
|
||||
GetAirportWidth(2): -1
|
||||
GetAirportHeight(2): -1
|
||||
GetAirportCoverageRadius(2): -1
|
||||
IsValidAirportType(3): false
|
||||
GetAirportWidth(3): -1
|
||||
GetAirportHeight(3): -1
|
||||
GetAirportCoverageRadius(3): -1
|
||||
IsValidAirportType(4): false
|
||||
GetAirportWidth(4): -1
|
||||
GetAirportHeight(4): -1
|
||||
GetAirportCoverageRadius(4): -1
|
||||
IsValidAirportType(5): false
|
||||
GetAirportWidth(5): -1
|
||||
GetAirportHeight(5): -1
|
||||
GetAirportCoverageRadius(5): -1
|
||||
IsValidAirportType(6): false
|
||||
GetAirportWidth(6): -1
|
||||
GetAirportHeight(6): -1
|
||||
GetAirportCoverageRadius(6): -1
|
||||
IsValidAirportType(7): false
|
||||
GetAirportWidth(7): -1
|
||||
GetAirportHeight(7): -1
|
||||
GetAirportCoverageRadius(7): -1
|
||||
IsValidAirportType(8): false
|
||||
GetAirportWidth(8): -1
|
||||
GetAirportHeight(8): -1
|
||||
GetAirportCoverageRadius(8): -1
|
||||
IsValidAirportType(9): false
|
||||
GetAirportWidth(9): -1
|
||||
GetAirportHeight(9): -1
|
||||
GetAirportCoverageRadius(9): -1
|
||||
GetBankBalance(): 100000
|
||||
GetPrice(): 84
|
||||
BuildAirport(): true
|
||||
|
@@ -1,27 +1,3 @@
|
||||
0.7.3 (2009-10-01)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: [NewGRF] Crash when trying to build an industry that has no industry layout defined [FS#3233] (r17638, r17633)
|
||||
|
||||
|
||||
0.7.3-RC2 (2009-09-24)
|
||||
------------------------------------------------------------------------
|
||||
- Update: Documentation about bug reporting and known bugs (r17554)
|
||||
- Fix: When a command did not fail in test run and failed in execution run, error message was not set. Affects only few commands (r17607)
|
||||
- Fix: [NewGRF] Crash when defining the same tile in a tile layout twice [FS#3218] (r17605)
|
||||
- Fix: Vehicle image was not always updated when needed (r17594)
|
||||
- Fix: [NoAI] Could not query the size of small airports when they could not be build anymore [FS#3212] (r17591)
|
||||
- Fix: Erroneous message about changing the difficulty level [FS#3220] (r17588)
|
||||
- Fix: Assertion triggered when the second vehicle in a 101+ (or 11+ if mammoth trains is disabled) vehicle free wagon chain is an engine and the first vehicle is moved to another chain [FS#3208] (r17576)
|
||||
- Fix: [NewGRF] Memory leak when viewing the NewGRF settings of a server (r17563)
|
||||
- Fix: [NewGRF] The NewGRF settings of (remote) network games did not get properly updated when the NewGRFs were rescanned causing reading of freed data [FS#2972] (r17562)
|
||||
- Fix: [NewGRF] Close the "Add NewGRF" window when you close the "NewGRF Settings" window. The add window has a pointer to the settings which means that not deleting it would cause dereferencing an already freed pointer [FS#3206] (r17559)
|
||||
- Fix: Vehicles waiting for their time table did not load anymore after their initial load was completed [FS#3201] (r17551)
|
||||
- Fix: Aircraft were given an unfair advantage in station rating calculations (r17550)
|
||||
- Fix: [NewGRF] Sign extending of profit calculation did not work (r17546)
|
||||
- Fix: [NoAI] AIs had "infinite" time when running code from the global scope [FS#3202] (r17545)
|
||||
- Fix: [NoAI] Crash when doing commands in the "global" scope [FS#3202] (r17544)
|
||||
|
||||
|
||||
0.7.3-RC1 (2009-09-13)
|
||||
------------------------------------------------------------------------
|
||||
- Add: [NoAI] AITown::GetLastMonthTransportedPercentage and AIIndustry::GetLastMonthTransportedPercentage (r17294)
|
||||
|
@@ -5,7 +5,7 @@ log() {
|
||||
}
|
||||
|
||||
set_default() {
|
||||
released_version="0.7.3"
|
||||
released_version="0.7.3-RC1"
|
||||
|
||||
ignore_extra_parameters="0"
|
||||
# We set all kinds of defaults for params. Later on the user can override
|
||||
@@ -47,8 +47,8 @@ set_default() {
|
||||
enable_static="1"
|
||||
enable_translator="0"
|
||||
enable_unicode="1"
|
||||
enable_assert="0"
|
||||
enable_strip="1"
|
||||
enable_assert="1"
|
||||
enable_strip="0"
|
||||
enable_universal="1"
|
||||
enable_osx_g5="0"
|
||||
enable_cocoa_quartz="1"
|
||||
|
110
known-bugs.txt
110
known-bugs.txt
@@ -1,18 +1,5 @@
|
||||
OpenTTD's known bugs
|
||||
Last updated: 2009-10-01
|
||||
Release version: 0.7.3
|
||||
README
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Table of Contents:
|
||||
------------------
|
||||
1) About
|
||||
2) Known bugs in the this stable release
|
||||
3) Known bugs that will not be solved
|
||||
|
||||
|
||||
1) 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!!
|
||||
@@ -21,104 +8,27 @@ Of course if you have more knowledge about any of these bugs, have more
|
||||
specifics, we welcome you to report them. React to the given bug indicated
|
||||
by the number below on http://bugs.openttd.org.
|
||||
|
||||
If the bug report is closed, it has been fixed, which then can be verified
|
||||
in the latest SVN version of /trunk.
|
||||
|
||||
2) Known bugs in the this stable release:
|
||||
-- --------------------------------------
|
||||
The following bugs are known to exist in this stable 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 will not be solved" section.
|
||||
Bugs for 0.7.2
|
||||
------------------------------------------------------------------------
|
||||
URL: http://bugs.openttd.org
|
||||
|
||||
The bugs in this section all refer to a ticket in our bug tracking system
|
||||
that you can find at: http://bugs.openttd.org
|
||||
If the bugs are closed but still listed here it means that the bug is fixed
|
||||
and that the nightlies and next major release will not have that bug.
|
||||
|
||||
- 3198 [OSX] "Could not get system colour space" error on some Mac OS X 10.6
|
||||
- 3194 [OSX] Full screen 'strobing' on some Mac OS X 10.6
|
||||
- 3190 [OSX] Compiling fails on some Mac OS X 10.6
|
||||
- 3159 [NewGRF] Autoreplace resets (or does not keep) value of variable F2
|
||||
- 3057 Road vehicle sometimes 'forget' the need for servicing
|
||||
- 3040 Not all alternatives are always shown in the "Join station" list
|
||||
- 2955 With path signals depots are less likely to be visited
|
||||
- 2891 Ignore signal does not keep the train running when in path signalled block till the next signal
|
||||
- 2769 No offer for buying bankrupt AIs
|
||||
- 2616 [NewGRF] Cloning creates vehicles with invalid subcargos
|
||||
- 2613 [NewGRF] House property 15 does not work
|
||||
- 2737 Self-crossing trains ignore "forbid 90 degree turn" setting
|
||||
- 2616 Cloning creates vehicles with invalid subcargos
|
||||
- 2585 [OSX] OS' mouse pointer showing
|
||||
- 2484 [OSX] Cannot enter CJK characters
|
||||
- 2427 Vehicle owner gets paid for whole cargo feeder share
|
||||
- 1944 Road vehicles not picking empty drivethrough platform
|
||||
- 1762 Strange Autoreplace behaviour
|
||||
- 1495 Long vehicles might block multistop drivethrough stations
|
||||
- 1473 Lost trains ignore exit signals
|
||||
- 1140 [OSX] Not smooth moving map with touchpad
|
||||
- 1072 Text overflows in several windows
|
||||
|
||||
|
||||
3) 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
|
||||
be able to completely fix them.
|
||||
|
||||
Clipping problems
|
||||
In some cases sprites are not drawn as one would expect. Examples of
|
||||
this are aircraft that might be hidden below the runway or trees that
|
||||
in some cases are rendered over vehicles.
|
||||
The primary cause of this problem is that OpenTTD does not have enough
|
||||
data (like a 3D model) to properly determine what needs to be drawn in
|
||||
front of what. OpenTTD has bounding boxes but in lots of cases they
|
||||
are either too big or too small and then cause problems with what
|
||||
needs to be drawn in front of what. Also some visual tricks are used.
|
||||
For example trains at 8 pixels high, the catenary needs to be drawn
|
||||
above that. When you want to draw bridges on top of that, which are
|
||||
only one height level (= 8 pixels) higher, you are getting into some
|
||||
big problems.
|
||||
We can not change the height levels; it would require us to either
|
||||
redraw all vehicle or all landscape graphics. Doing so would mean we
|
||||
leave the Transport Tycoon graphics, which in effect means OpenTTD
|
||||
will not be a Transport Tycoon clone anymore.
|
||||
|
||||
Duplicate (station) names after renaming
|
||||
After renaming stations one can create duplicate station names. This
|
||||
is done giving a station the same custom name as another station with
|
||||
an automatically generated name.
|
||||
The major part of this problem is that station names are translatable.
|
||||
Meaning that a station is called e.g. '<TOWN> Central' in English and
|
||||
'<TOWN> Centraal' in Dutch. This means that in network games the
|
||||
renaming of a town could cause the rename to succeed on some clients
|
||||
and fail at others. This creates an inconsistent game state that will
|
||||
be seen as a 'desync'. Secondly the custom names are intended to fall
|
||||
completely outside of the '<TOWN> <name>' naming of stations, so when
|
||||
you rename a town all station names are updated accordingly.
|
||||
As a result the decision has been made that all custom names are only
|
||||
compared to the other custom names in the same class and not compared
|
||||
to the automatically generated names.
|
||||
|
||||
Forbid 90 degree turns does not work for crossing PBS paths
|
||||
When you run a train through itself on a X junction with PBS turned on
|
||||
the train will not obey the 'forbid 90 degree turns' setting. This is
|
||||
due to the fact that we can not be sure that the setting was turned
|
||||
off when the track was reserved, which means that we assume it was
|
||||
turned on and that the setting does not hold at the time. We made it
|
||||
this way to allow one to change the setting in-game, but it breaks
|
||||
slightly when you are running your train through itself. Running a
|
||||
train through means that your network is broken and is thus a user
|
||||
error which OpenTTD tries to graciously handle.
|
||||
Fixing this bug means that we need to record whether this particular
|
||||
setting was turned on or off at the time the reservation was made. This
|
||||
means adding quite a bit of data to the savegame for solving an issue
|
||||
that is basically an user error. We think it is not worth the effort.
|
||||
|
||||
Lost trains ignore (block) exit signals
|
||||
If trains are lost they ignore block exit signals, blocking junctions
|
||||
with presignals. This is caused because the path finders cannot tell
|
||||
where the train needs to go. As such a random direction is chosen at
|
||||
each junction. This causes the trains to occasionally to make choices
|
||||
that are unwanted from a player's point of view.
|
||||
This will not be fixed because lost trains are in almost all cases a
|
||||
network problem, e.g. a train can never reach a specific place. This
|
||||
makes the impact of fixing the bug enormously small against the
|
||||
amount of work needed to write a system that prevents the lost trains
|
||||
from taking the wrong direction.
|
||||
- 119 Clipping problems with vehicles on slopes
|
||||
|
@@ -1,15 +1,3 @@
|
||||
openttd (0.7.3) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <matthijs@stdin.nl> Thu, 01 Oct 2009 12:35:47 +0200
|
||||
|
||||
openttd (0.7.3~RC2) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <matthijs@stdin.nl> Thu, 24 Sep 2009 21:30:43 +0200
|
||||
|
||||
openttd (0.7.3~RC1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
@@ -24,9 +24,10 @@ Summary: OpenTTD is an Open Source clone of Chris Sawyer's Transport Tycoo
|
||||
Source: %{name}-%{version}-source.tar.bz2
|
||||
|
||||
Requires: fontconfig
|
||||
Requires: libicu
|
||||
Requires: libpng
|
||||
Requires: SDL
|
||||
Requires: zlib
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: fontconfig-devel
|
||||
BuildRequires: libpng-devel
|
||||
BuildRequires: libicu-devel
|
||||
@@ -37,32 +38,33 @@ BuildRequires: zlib-devel
|
||||
Requires: freetype
|
||||
BuildRequires: freetype-devel
|
||||
%endif
|
||||
%if %{_vendor}=="MandrakeSoft" || %{_vendor}=="mandriva"
|
||||
Requires: freetype2
|
||||
BuildRequires: libfreetype6-devel
|
||||
%endif
|
||||
%if %{_vendor}=="redhat" || %{_vendor}=="fedora"
|
||||
Requires: freetype
|
||||
BuildRequires: freetype-devel
|
||||
BuildRequires: desktop-file-utils
|
||||
%endif
|
||||
%if %{_vendor}=="suse" || %{_vendor}=="mandriva"
|
||||
%if %{_vendor}=="suse"
|
||||
Requires: freetype2
|
||||
BuildRequires: freetype2-devel
|
||||
%endif
|
||||
%if %{_vendor}=="suse"
|
||||
BuildRequires: update-desktop-files
|
||||
%endif
|
||||
|
||||
# recommends works for suse (not sles9) and mandriva, only
|
||||
%if 0%{?suse_version} > 910 || %{_vendor}=="mandriva"
|
||||
Recommends: opengfx
|
||||
# for 0.8.0
|
||||
#Recommends: opensfx
|
||||
%endif
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
||||
|
||||
%description
|
||||
OpenTTD is a reimplementation of the Microprose game "Transport Tycoon Deluxe"
|
||||
with lots of new features and enhancements. To play the game you need either
|
||||
the original data from the game or install the recommend package OpenGFX.
|
||||
with lots of new features and enhancements. To play the game you need to copy
|
||||
the following 6 data files from your Transport Tycoon Deluxe CD to the game
|
||||
data directory in %{_datadir}/games/%{name}/data:
|
||||
|
||||
From the Windows version of TTD you need:
|
||||
sample.cat trg1r.grf trgcr.grf trghr.grf trgir.grf trgtr.grf
|
||||
|
||||
Or if you have the DOS version you need:
|
||||
sample.cat TRG1.GRF TRGC.GRF TRGH.GRF TRGI.GRF TRGT.GRF
|
||||
|
||||
OpenTTD is licensed under the GNU General Public License version 2.0. For more
|
||||
information, see the file 'COPYING' included with every release and source
|
||||
@@ -72,29 +74,22 @@ download of the game.
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
# suse sle <10 has no support for makedepend
|
||||
%if 0%{?sles_version} == 9 || 0%{?sles_version} == 10
|
||||
%define do_makedepend 0
|
||||
%else
|
||||
%define do_makedepend 1
|
||||
%endif
|
||||
./configure \
|
||||
--revision=%{version} \
|
||||
--prefix-dir="%{_prefix}" \
|
||||
--binary-name="%{name}" \
|
||||
--enable-strip \
|
||||
--binary-dir="bin" \
|
||||
--data-dir="share/%{name}" \
|
||||
--with-makedepend="%{do_makedepend}" \
|
||||
# --revision="%{ver}%{?prever:-%{prever}}" \
|
||||
# --enable-debug=0 \
|
||||
# --with-sdl \
|
||||
# --with-zlib \
|
||||
# --with-png \
|
||||
# --with-freetype \
|
||||
# --with-fontconfig \
|
||||
# --with-icu \
|
||||
--binary-name="%{name}" \
|
||||
--enable-debug=0 \
|
||||
--with-sdl \
|
||||
--with-zlib \
|
||||
--with-png \
|
||||
--with-freetype \
|
||||
--with-fontconfig \
|
||||
--with-icu \
|
||||
--enable-strip \
|
||||
# --menu_group="Game;" \
|
||||
# --menu-name="OpenTTD" \
|
||||
# --data-dir="share\games\%{name}" \
|
||||
# --doc-dir="share\doc\%{name}" \
|
||||
# --icon-dir="share/pixmaps" \
|
||||
# --icon-theme-dir="share/icons/hicolor" \
|
||||
@@ -104,6 +99,7 @@ download of the game.
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
rm -rf "%{buildroot}"
|
||||
make install INSTALL_DIR="%{buildroot}"
|
||||
|
||||
# Validate menu entrys (vendor specific)
|
||||
@@ -115,28 +111,13 @@ desktop-file-install \
|
||||
"%{buildroot}/%{_datadir}/applications/%{name}.desktop" \
|
||||
# --delete-original
|
||||
%endif
|
||||
%if %{_vendor}=="suse"
|
||||
%__cat > %{name}.desktop << EOF
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=OpenTTD
|
||||
Comment=OpenTTD - A clone of the Microprose game 'Transport Tycoon Deluxe'
|
||||
GenericName=OpenTTD
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Exec=%{name}
|
||||
Icon=%{name}
|
||||
Categories=Game;StrategyGame;
|
||||
EOF
|
||||
%suse_update_desktop_file -i %{name} Game StrategyGame
|
||||
%endif
|
||||
|
||||
%clean
|
||||
#rm -rf "%{buildroot}"
|
||||
rm -rf "%{buildroot}"
|
||||
|
||||
%post
|
||||
# Update the icon cache (vendor specific)
|
||||
%if %{_vendor}=="mandriva"
|
||||
%if %{_vendor}=="MandrakeSoft" || %{_vendor}=="mandriva"
|
||||
%update_icon_cache hicolor
|
||||
%endif
|
||||
|
||||
@@ -149,7 +130,7 @@ fi
|
||||
|
||||
%postun
|
||||
# Update the icon cache (vendor specific)
|
||||
%if %{_vendor}=="mandriva"
|
||||
%if %{_vendor}=="MandrakeSoft" || %{_vendor}=="mandriva"
|
||||
%update_icon_cache hicolor
|
||||
%endif
|
||||
|
||||
@@ -163,39 +144,38 @@ fi
|
||||
%files
|
||||
%defattr(-, root, games, -)
|
||||
%dir %{_datadir}/doc/%{name}
|
||||
%dir %{_datadir}/%{name}
|
||||
%dir %{_datadir}/%{name}/lang
|
||||
%dir %{_datadir}/%{name}/data
|
||||
%dir %{_datadir}/%{name}/gm
|
||||
%dir %{_datadir}/%{name}/scripts
|
||||
%dir %{_datadir}/games/%{name}
|
||||
%dir %{_datadir}/games/%{name}/lang
|
||||
%dir %{_datadir}/games/%{name}/data
|
||||
%dir %{_datadir}/games/%{name}/gm
|
||||
%attr(755, root, games) %{_bindir}/%{name}
|
||||
%{_datadir}/doc/%{name}/*
|
||||
%{_datadir}/%{name}/lang/*
|
||||
%{_datadir}/%{name}/data/*
|
||||
%{_datadir}/%{name}/scripts/*
|
||||
%{_datadir}/games/%{name}/lang/*
|
||||
%{_datadir}/games/%{name}/data/*
|
||||
%{_datadir}/games/%{name}/scripts/*
|
||||
%{_datadir}/applications/*%{name}.desktop
|
||||
%{_datadir}/pixmaps/*
|
||||
%{_datadir}/icons/*
|
||||
%doc %{_mandir}/man6/%{name}.6.*
|
||||
%{_datadir}/icons/hicolor/*/apps/%{name}.png
|
||||
%doc %{_mandir}/man6/%{name}.6.gz
|
||||
|
||||
%changelog
|
||||
* Sat Sep 26 2009 Marcel Gmür <ammler@openttdcoop.org> - 0.7.2
|
||||
- no subfolder games for datadir
|
||||
- cleanup: no post and postun anymore
|
||||
- Recommends: opengfx (for suse and mandriva)
|
||||
- add SUSE support
|
||||
|
||||
* Mon Oct 20 2008 Benedikt Brüggemeier <skidd13@openttd.org>
|
||||
|
||||
- Added libicu dependency
|
||||
|
||||
* Thu Sep 23 2008 Benedikt Brüggemeier <skidd13@openttd.org>
|
||||
|
||||
- Merged both versions of the spec file
|
||||
|
||||
* Fri Aug 29 2008 Jonathan Coome <maedhros@openttd.org>
|
||||
|
||||
- Rewrite spec file from scratch.
|
||||
|
||||
* Sat Aug 02 2008 Benedikt Brüggemeier <skidd13@openttd.org>
|
||||
|
||||
- Updated spec file
|
||||
|
||||
* Thu Mar 27 2008 Denis Burlaka <burlaka@yandex.ru>
|
||||
|
||||
- Universal spec file
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
!define APPNAME "OpenTTD" ; Define application name
|
||||
!define APPVERSION "0.7.3" ; Define application version
|
||||
!define APPVERSION "0.7.3-RC1" ; Define application version
|
||||
!define APPVERSIONINTERNAL "0.7.3.0" ; Define application version in X.X.X.X
|
||||
!define INSTALLERVERSION 68 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
|
||||
!define INSTALLERVERSION 66 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
|
||||
!include ${VERSION_INCLUDE}
|
||||
|
||||
!define APPURLLINK "http://www.openttd.org"
|
||||
|
@@ -32,7 +32,7 @@ Sub UpdateFiles(version)
|
||||
modified = Mid(version, InStrRev(version, Chr(9)) + 1)
|
||||
version = Mid(version, 1, InStr(version, Chr(9)) - 1)
|
||||
Else
|
||||
version = "0.7.3"
|
||||
version = "0.7.3-RC1"
|
||||
revision = 0
|
||||
modified = 1
|
||||
End If
|
||||
|
@@ -60,7 +60,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -273,7 +273,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -2635,10 +2635,6 @@
|
||||
RelativePath=".\..\src\ai\api\ai_industrytypelist.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\ai\api\ai_info_docs.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\ai\api\ai_list.hpp"
|
||||
>
|
||||
|
@@ -60,7 +60,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -273,7 +273,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
|
@@ -61,7 +61,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -271,7 +271,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -2632,10 +2632,6 @@
|
||||
RelativePath=".\..\src\ai\api\ai_industrytypelist.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\ai\api\ai_info_docs.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\..\src\ai\api\ai_list.hpp"
|
||||
>
|
||||
|
@@ -61,7 +61,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
@@ -271,7 +271,7 @@
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="true"
|
||||
AdditionalIncludeDirectories="..\objs\langs;..\src\3rdparty\squirrel\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_EXCEPTION_TRACKER;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_PNG;WITH_FREETYPE;WITH_ICU;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
RuntimeLibrary="0"
|
||||
|
58
readme.txt
58
readme.txt
@@ -1,6 +1,6 @@
|
||||
OpenTTD README
|
||||
Last updated: 2009-10-01
|
||||
Release version: 0.7.3
|
||||
Last updated: 2009-08-18
|
||||
Release version: 0.7.2
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -49,41 +49,25 @@ http://forum.openttd.org/
|
||||
|
||||
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.
|
||||
To report a bug, please create a Flyspray account and follow the bugs
|
||||
link from our homepage. Please make sure the bug is reproducible and
|
||||
still occurs in the latest daily build or the current SVN version. Also
|
||||
please look through the existing bug reports briefly to see whether the bug
|
||||
is not already known.
|
||||
|
||||
For tracking our bugs we are using a bug tracker called Flyspray. You can find
|
||||
the tracker at http://bugs.openttd.org/. Before actually reporting take a look
|
||||
through the already reported bugs there to see if the bug is already known.
|
||||
The 'known-bugs.txt' file might be a bit outdated at the moment you are
|
||||
reading it as only bugs known before the release are documented there. Also
|
||||
look through the recently closed bugs.
|
||||
The Flyspray project page URL is: http://bugs.openttd.org/
|
||||
|
||||
When you are sure it is not already reported you should:
|
||||
* Make sure you are running a recent version, i.e. run the latest stable or
|
||||
nightly based on where you found the bug.
|
||||
* Make sure you are not running a non-official binary, like a patch pack.
|
||||
When you are playing with a patch pack you should report any bugs to the
|
||||
forum thread related to that patch pack.
|
||||
* Make it reproducable for the developers. In other words, create a savegame
|
||||
in which you can reproduce the issue once loaded. It is very useful to give
|
||||
us the crash.dmp, crash.sav and crash.log which are created on crashes.
|
||||
* Check whether the bug is already reported on our bug tracker. This includes
|
||||
searching for recently closed bug reports as the bug might already be fixed.
|
||||
|
||||
After you have done all that you can report the bug. Please include the
|
||||
following information in your bug report:
|
||||
* OpenTTD version (PLEASE test the latest SVN/nightly build)
|
||||
* Bug details, including instructions how to reproduce it
|
||||
* Platform (Win32, Linux, FreeBSD, ...) and compiler (including version) if
|
||||
you compiled OpenTTD yourself.
|
||||
* Attach a saved game *and* a screenshot if possible
|
||||
* If this bug only occurred recently please note the last version without
|
||||
the bug and the first version including the bug. That way we can fix it
|
||||
quicker by looking at the changes made.
|
||||
* 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.
|
||||
Please include the following information in your bug report:
|
||||
- OpenTTD version (PLEASE test the latest SVN/nightly build)
|
||||
- Bug details, including instructions how to reproduce it
|
||||
- Platform and compiler (Win32, Linux, FreeBSD, ...)
|
||||
- Attach a saved game *and* a screenshot if possible
|
||||
- If this bug only occurred recently please note the last
|
||||
version without the bug and the first version including
|
||||
the bug. That way we can fix it quicker by looking at the
|
||||
changes made.
|
||||
- Attach crash.dmp, crash.log and crash.sav from the data
|
||||
directory if they exist.
|
||||
|
||||
2.2) Reporting Desyncs:
|
||||
---- ------------------
|
||||
@@ -499,7 +483,7 @@ The OpenTTD team (in alphabetical order):
|
||||
Owen Rudge (orudge) - Forum host, OS/2 port
|
||||
Peter Nelson (peter1138) - Spiritual descendant from newGRF gods
|
||||
Remko Bijker (Rubidium) - Lead coder and way more
|
||||
Zdeněk Sojka (SmatZ) - Bug finder and fixer
|
||||
Zdenek Sojka (SmatZ) - Bug finder and fixer
|
||||
Thijs Marinussen (Yexo) - AI Framework
|
||||
|
||||
Inactive Developers:
|
||||
@@ -519,7 +503,7 @@ Retired Developers:
|
||||
Thanks to:
|
||||
Josef Drexler - For his great work on TTDPatch.
|
||||
Marcin Grzegorczyk - For his TTDPatch work and documentation of TTD internals and graphics (signals and track foundations)
|
||||
Petr Baudiš (pasky) - Many patches, newgrf support, etc.
|
||||
Petr Baudis (pasky) - Many patches, newgrf support, etc.
|
||||
Simon Sasburg (HackyKid) - For the many bugfixes he has blessed us with
|
||||
Stefan Meißner (sign_de) - For his work on the console
|
||||
Mike Ragsdale - OpenTTD installer
|
||||
|
@@ -612,7 +612,6 @@ ai/api/ai_industry.hpp
|
||||
ai/api/ai_industrylist.hpp
|
||||
ai/api/ai_industrytype.hpp
|
||||
ai/api/ai_industrytypelist.hpp
|
||||
ai/api/ai_info_docs.hpp
|
||||
ai/api/ai_list.hpp
|
||||
ai/api/ai_log.hpp
|
||||
ai/api/ai_map.hpp
|
||||
|
@@ -122,31 +122,21 @@ AIInstance::AIInstance(AIInfo *info) :
|
||||
/* Register the API functions and classes */
|
||||
this->RegisterAPI();
|
||||
|
||||
try {
|
||||
AIObject::SetAllowDoCommand(false);
|
||||
/* Load and execute the script for this AI */
|
||||
const char *main_script = info->GetMainScript();
|
||||
if (strcmp(main_script, "%_dummy") == 0) {
|
||||
extern void AI_CreateAIDummy(HSQUIRRELVM vm);
|
||||
AI_CreateAIDummy(this->engine->GetVM());
|
||||
} else if (!this->engine->LoadScript(main_script) || this->engine->IsSuspended()) {
|
||||
if (this->engine->IsSuspended()) AILog::Error("This AI took too long to load script. AI is not started.");
|
||||
this->Died();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Create the main-class */
|
||||
this->instance = MallocT<SQObject>(1);
|
||||
if (!this->engine->CreateClassInstance(info->GetInstanceName(), this->controller, this->instance)) {
|
||||
this->Died();
|
||||
return;
|
||||
}
|
||||
AIObject::SetAllowDoCommand(true);
|
||||
} catch (AI_FatalError e) {
|
||||
this->is_dead = true;
|
||||
this->engine->ThrowError(e.GetErrorMessage());
|
||||
this->engine->ResumeError();
|
||||
/* Load and execute the script for this AI */
|
||||
const char *main_script = info->GetMainScript();
|
||||
if (strcmp(main_script, "%_dummy") == 0) {
|
||||
extern void AI_CreateAIDummy(HSQUIRRELVM vm);
|
||||
AI_CreateAIDummy(this->engine->GetVM());
|
||||
} else if (!this->engine->LoadScript(main_script)) {
|
||||
this->Died();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Create the main-class */
|
||||
this->instance = MallocT<SQObject>(1);
|
||||
if (!this->engine->CreateClassInstance(info->GetInstanceName(), this->controller, this->instance)) {
|
||||
this->Died();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -12,12 +12,7 @@
|
||||
|
||||
/* static */ bool AIAirport::IsValidAirportType(AirportType type)
|
||||
{
|
||||
return IsAirportInformationAvailable(type) && HasBit(::GetValidAirports(), type);
|
||||
}
|
||||
|
||||
/* static */ bool AIAirport::IsAirportInformationAvailable(AirportType type)
|
||||
{
|
||||
return type >= 0 && type <= AT_HELISTATION;
|
||||
return type >= AT_SMALL && type <= AT_HELISTATION && HasBit(::GetValidAirports(), type);
|
||||
}
|
||||
|
||||
/* static */ Money AIAirport::GetPrice(AirportType type)
|
||||
@@ -44,21 +39,21 @@
|
||||
|
||||
/* static */ int32 AIAirport::GetAirportWidth(AirportType type)
|
||||
{
|
||||
if (!IsAirportInformationAvailable(type)) return -1;
|
||||
if (!IsValidAirportType(type)) return -1;
|
||||
|
||||
return ::GetAirport(type)->size_x;
|
||||
}
|
||||
|
||||
/* static */ int32 AIAirport::GetAirportHeight(AirportType type)
|
||||
{
|
||||
if (!IsAirportInformationAvailable(type)) return -1;
|
||||
if (!IsValidAirportType(type)) return -1;
|
||||
|
||||
return ::GetAirport(type)->size_y;
|
||||
}
|
||||
|
||||
/* static */ int32 AIAirport::GetAirportCoverageRadius(AirportType type)
|
||||
{
|
||||
if (!IsAirportInformationAvailable(type)) return -1;
|
||||
if (!IsValidAirportType(type)) return -1;
|
||||
|
||||
return _settings_game.station.modified_catchment ? ::GetAirport(type)->catchment : (uint)CA_UNMODIFIED;
|
||||
}
|
||||
@@ -141,7 +136,7 @@
|
||||
extern Town *AirportGetNearestTown(const AirportFTAClass *afc, TileIndex airport_tile);
|
||||
|
||||
if (!::IsValidTile(tile)) return INVALID_TOWN;
|
||||
if (!IsAirportInformationAvailable(type)) return INVALID_TOWN;
|
||||
if (!IsValidAirportType(type)) return INVALID_TOWN;
|
||||
|
||||
return AirportGetNearestTown(GetAirport(type), tile)->index;
|
||||
}
|
||||
|
@@ -50,24 +50,12 @@ public:
|
||||
* Checks whether the given AirportType is valid and available.
|
||||
* @param type The AirportType to check.
|
||||
* @return True if and only if the AirportType is valid and available.
|
||||
* @post return value == true -> IsAirportInformationAvailable returns true.
|
||||
*/
|
||||
static bool IsValidAirportType(AirportType type);
|
||||
|
||||
/**
|
||||
* Can you get information on this airport type? As opposed to
|
||||
* IsValidAirportType this will return also return true when
|
||||
* an airport type is no longer buildable.
|
||||
* @param type The AirportType to check.
|
||||
* @return True if and only if the AirportType is valid.
|
||||
* @post return value == false -> IsValidAirportType returns false.
|
||||
*/
|
||||
static bool IsAirportInformationAvailable(AirportType type);
|
||||
|
||||
/**
|
||||
* Get the cost to build this AirportType.
|
||||
* @param type The AirportType to check.
|
||||
* @pre AirportAvailable(type).
|
||||
* @return The cost of building this AirportType.
|
||||
*/
|
||||
static Money GetPrice(AirportType type);
|
||||
@@ -91,7 +79,6 @@ public:
|
||||
/**
|
||||
* Get the width of this type of airport.
|
||||
* @param type The type of airport.
|
||||
* @pre IsAirportInformationAvailable(type).
|
||||
* @return The width in tiles.
|
||||
*/
|
||||
static int32 GetAirportWidth(AirportType type);
|
||||
@@ -99,7 +86,6 @@ public:
|
||||
/**
|
||||
* Get the height of this type of airport.
|
||||
* @param type The type of airport.
|
||||
* @pre IsAirportInformationAvailable(type).
|
||||
* @return The height in tiles.
|
||||
*/
|
||||
static int32 GetAirportHeight(AirportType type);
|
||||
@@ -107,7 +93,6 @@ public:
|
||||
/**
|
||||
* Get the coverage radius of this type of airport.
|
||||
* @param type The type of airport.
|
||||
* @pre IsAirportInformationAvailable(type).
|
||||
* @return The radius in tiles.
|
||||
*/
|
||||
static int32 GetAirportCoverageRadius(AirportType type);
|
||||
@@ -182,7 +167,6 @@ public:
|
||||
* an airport at some tile.
|
||||
* @param tile The tile to check.
|
||||
* @param type The AirportType to check.
|
||||
* @pre IsAirportInformationAvailable(type).
|
||||
* @return The TownID of the town closest to the tile.
|
||||
*/
|
||||
static TownID GetNearestTown(TileIndex tile, AirportType type);
|
||||
|
@@ -38,21 +38,20 @@ void SQAIAirport_Register(Squirrel *engine) {
|
||||
SQAIAirport.DefSQConst(engine, AIAirport::PT_BIG_PLANE, "PT_BIG_PLANE");
|
||||
SQAIAirport.DefSQConst(engine, AIAirport::PT_INVALID, "PT_INVALID");
|
||||
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsValidAirportType, "IsValidAirportType", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsAirportInformationAvailable, "IsAirportInformationAvailable", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetPrice, "GetPrice", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsHangarTile, "IsHangarTile", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsAirportTile, "IsAirportTile", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportWidth, "GetAirportWidth", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportHeight, "GetAirportHeight", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportCoverageRadius, "GetAirportCoverageRadius", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetNumHangars, "GetNumHangars", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetHangarOfAirport, "GetHangarOfAirport", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::BuildAirport, "BuildAirport", 4, ".iii");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::RemoveAirport, "RemoveAirport", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportType, "GetAirportType", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetNoiseLevelIncrease, "GetNoiseLevelIncrease", 3, ".ii");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetNearestTown, "GetNearestTown", 3, ".ii");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsValidAirportType, "IsValidAirportType", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetPrice, "GetPrice", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsHangarTile, "IsHangarTile", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsAirportTile, "IsAirportTile", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportWidth, "GetAirportWidth", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportHeight, "GetAirportHeight", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportCoverageRadius, "GetAirportCoverageRadius", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetNumHangars, "GetNumHangars", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetHangarOfAirport, "GetHangarOfAirport", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::BuildAirport, "BuildAirport", 4, ".iii");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::RemoveAirport, "RemoveAirport", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportType, "GetAirportType", 2, ".i");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetNoiseLevelIncrease, "GetNoiseLevelIncrease", 3, ".ii");
|
||||
SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetNearestTown, "GetNearestTown", 3, ".ii");
|
||||
|
||||
SQAIAirport.PostRegister(engine);
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@
|
||||
* API additions:
|
||||
* \li AIAbstractList::SORT_ASCENDING
|
||||
* \li AIAbstractList::SORT_DESCENDING
|
||||
* \li AIAirport::IsAirportInformationAvailable
|
||||
* \li AICompany::GetPresidentGender
|
||||
* \li AICompany::SetPresidentGender
|
||||
* \li AIEngine::GetDesignDate
|
||||
@@ -28,7 +27,7 @@
|
||||
* Other changes:
|
||||
* \li AIs are now killed when they execute a DoCommand or Sleep at a time
|
||||
* they are not allowed to do so.
|
||||
* \li When the API requests a string as parameter you can give every squirrel
|
||||
* \li When the API requests a string as parameter you can give ever squirrel
|
||||
* type and it'll be converted to a string
|
||||
* \li AIs can create subclasses of API classes and use API constants as part
|
||||
* of their own constants
|
||||
|
@@ -1,239 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* This file is part of OpenTTD.
|
||||
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** @file ai_info_docs.hpp Description of the functions an AI can/must provide in AIInfo. */
|
||||
|
||||
/* This file exists purely for doxygen purposes. */
|
||||
#ifdef DOXYGEN_SKIP
|
||||
/**
|
||||
* 'Abstract' class of the class AIs/AI libraries use to register themselves.
|
||||
*
|
||||
* @note This class is not part of the API. It is purely to document what
|
||||
* AIs must or can implemented to provide information to OpenTTD to
|
||||
* base configuring/starting/loading the AI on.
|
||||
*
|
||||
* @note The required functions are also needed for AI Libraries. As such
|
||||
* the information here can be used for libraries, but the information
|
||||
* will not be shown in the GUI except for error/debug messages.
|
||||
*/
|
||||
class AIInfo {
|
||||
public:
|
||||
/**
|
||||
* Gets the author name to be shown in the 'Available AIs' window.
|
||||
*
|
||||
* @return The author name of the AI.
|
||||
* @note This function is required.
|
||||
*/
|
||||
string GetAuthor();
|
||||
|
||||
/**
|
||||
* Gets the AIs name. This is shown in the 'Available AIs' window
|
||||
* and at all other places where the AI is mentioned, like the debug
|
||||
* window or OpenTTD's help message. The name is used to uniquely
|
||||
* identify an AI within OpenTTD and this name is used in savegames
|
||||
* and the configuration file.
|
||||
*
|
||||
* @return The name of the AI.
|
||||
* @note This function is required.
|
||||
*/
|
||||
string GetName();
|
||||
|
||||
/**
|
||||
* Gets a 4 ASCII character short name of the AI to uniquely
|
||||
* identify it from other AIs. The short name is primarily
|
||||
* used as unique identifier for the content system.
|
||||
* The content system uses besides the short name also the
|
||||
* MD5 checksum of all the source files to uniquely identify
|
||||
* a specific version of the AI.
|
||||
*
|
||||
* The short name must consist of precisely four ASCII
|
||||
* characters, or more precisely four non-zero bytes.
|
||||
*
|
||||
* @return The name of the AI.
|
||||
* @note This function is required.
|
||||
*/
|
||||
string GetShortName();
|
||||
|
||||
/**
|
||||
* Gets the description to be shown in the 'Available AIs' window.
|
||||
*
|
||||
* @return The description for the AI.
|
||||
* @note This function is required.
|
||||
*/
|
||||
string GetDescription();
|
||||
|
||||
/**
|
||||
* Gets the version of the AI. This is a number to (in theory)
|
||||
* uniquely identify the versions of an AI. Generally the
|
||||
* 'instance' of an AI with the highest version is chosen to
|
||||
* be loaded.
|
||||
*
|
||||
* When OpenTTD finds, during starting, a duplicate AI with the
|
||||
* same version number one is randomly chosen. So it is
|
||||
* important that this number is regularly updated/incremented.
|
||||
*
|
||||
* @return The version number of the AI.
|
||||
* @note This function is required.
|
||||
*/
|
||||
int GetVersion();
|
||||
|
||||
/**
|
||||
* Gets the lowest version of the AI that OpenTTD can still load
|
||||
* the savegame of. In other words, from which version until this
|
||||
* version can the AI load the savegames.
|
||||
*
|
||||
* If this function does not exist OpenTTD assumes it can only
|
||||
* load savegames of this version. As such it will not upgrade
|
||||
* to this version upon load.
|
||||
*
|
||||
* @return The lowest version number we load the savegame data.
|
||||
* @note This function is optional.
|
||||
*/
|
||||
int MinVersionToLoad();
|
||||
|
||||
/**
|
||||
* Gets the development/release date of the AI.
|
||||
*
|
||||
* The intention of this is to give the user an idea how old the
|
||||
* AI is and whether there might be a newer version.
|
||||
*
|
||||
* @return The development/release date for the AI.
|
||||
* @note This function is required.
|
||||
*/
|
||||
string GetDate();
|
||||
|
||||
/**
|
||||
* Can this AI be used as random AI?
|
||||
*
|
||||
* The idea behind this function is to 'forbid' highly
|
||||
* competitive or other special AIs from running in games unless
|
||||
* the user explicitly selects the AI to be loaded. This to
|
||||
* try to prevent users from complaining that the AI is too
|
||||
* aggressive or does not build profitable routes.
|
||||
*
|
||||
* If this function does not exist OpenTTD assumes the AI can
|
||||
* be used as random AI. As such it will be randomly chosen.
|
||||
*
|
||||
* @return True if the AI can be used as random AI.
|
||||
* @note This function is optional.
|
||||
*/
|
||||
bool UseAsRandomAI();
|
||||
|
||||
/**
|
||||
* Gets the name of main class of the AI so OpenTTD knows
|
||||
* what class to instantiate.
|
||||
*
|
||||
* @return The class name of the AI.
|
||||
* @note This function is required.
|
||||
*/
|
||||
string CreateInstance();
|
||||
|
||||
/**
|
||||
* Gets the API version this AI is written for. If this function
|
||||
* does not exist API compatability with version 0.7 is assumed.
|
||||
* If the function returns something OpenTTD does not understand,
|
||||
* for example a newer version or a string that is not a version,
|
||||
* the AI will not be loaded.
|
||||
*
|
||||
* Although in the future we might need to make a separate
|
||||
* compatability 'wrapper' for a specific version of OpenTTD, for
|
||||
* example '0.7.1', we will use only the major and minor number
|
||||
* and not the bugfix number as valid return for this function.
|
||||
*
|
||||
* Valid return values are:
|
||||
* - "0.7"
|
||||
*
|
||||
* @return The version this AI is compatible with.
|
||||
* @note This function is optional.
|
||||
*/
|
||||
string GetAPIVersion();
|
||||
|
||||
/**
|
||||
* Gets the URL to be shown in the 'this AI has crashed' message
|
||||
* and in the 'Available AIs' window. If this function does not
|
||||
* exist no URL will be shown.
|
||||
*
|
||||
* This function purely exists to redirect users of the AI to the
|
||||
* right place on the internet to discuss the AI and report bugs
|
||||
* of this AI.
|
||||
*
|
||||
* @return The URL to show.
|
||||
* @note This function is optional.
|
||||
*/
|
||||
string GetURL();
|
||||
|
||||
/**
|
||||
* Gets the settings that OpenTTD shows in the "AI Parameters" window
|
||||
* so the user can customize the AI. This is a special function that
|
||||
* doesn't need to return anything. Instead you can call AddSetting
|
||||
* and AddLabels here.
|
||||
*
|
||||
* @note This function is optional.
|
||||
*/
|
||||
void GetSettings();
|
||||
|
||||
/** Miscellaneous flags for AI settings. */
|
||||
enum AIConfigFlags {
|
||||
AICONFIG_NONE, //!< Normal setting.
|
||||
AICONFIG_RANDOM, //!< When randomizing the AI, pick any value between min_value and max_value.
|
||||
AICONFIG_BOOLEAN, //!< This value is a boolean (either 0 (false) or 1 (true) ).
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a user configurable setting for this AI. You can call this
|
||||
* as many times as you have settings.
|
||||
* @param setting_description A table with all information about a
|
||||
* single setting. The table should have the following name/value pairs:
|
||||
* - name The name of the setting, this is used in openttd.cfg to
|
||||
* store the current configuration of AIs. Required.
|
||||
* - description A single line describing the setting. Required.
|
||||
* - min_value The minimum value of this setting. Required for integer
|
||||
* settings and not allowed for boolean settings.
|
||||
* - max_value The maximum value of this setting. Required for integer
|
||||
* settings and not allowed for boolean settings.
|
||||
* - easy_value The default value if the easy difficulty level
|
||||
* is selected. Required.
|
||||
* - medium_value The default value if the medium difficulty level
|
||||
* is selected. Required.
|
||||
* - hard_value The default value if the hard difficulty level
|
||||
* is selected. Required.
|
||||
* - custom_value The default value if the custom difficulty level
|
||||
* is selected. Required.
|
||||
* - random_deviation If this property has a nonzero value, then the
|
||||
* actual value of the setting in game will be
|
||||
* user_configured_value + random(-random_deviation, random_deviation).
|
||||
* Not allowed if the AICONFIG_RANDOM flag is set, otherwise optional.
|
||||
* - step_size The increase/decrease of the value every time the user
|
||||
* clicks one of the up/down arrow buttons. Optional, default is 1.
|
||||
* - flags Bitmask of some flags, see AIConfigFlags. Required.
|
||||
*
|
||||
* @note This is a function provided by OpenTTD, you don't have to
|
||||
* include it in your AI but should just call it from GetSettings.
|
||||
*/
|
||||
void AddSetting(table setting_description);
|
||||
|
||||
/**
|
||||
* Add labels for the values of a setting. Instead of a number the
|
||||
* user will see the corresponding name.
|
||||
* @param setting_name The name of the setting.
|
||||
* @param value_names A table that maps values to names. The first
|
||||
* character of every identifier is ignored and the rest should
|
||||
* be the an integer of the value you define a name for. The value
|
||||
* is a short description of that value.
|
||||
* To define labels for a setting named "competition_level" you could
|
||||
* for example call it like this:
|
||||
* AddLabels("competition_level", {_0 = "no competition", _1 = "some competition",
|
||||
* _2 = "a lot of competition"});
|
||||
*
|
||||
* @note This is a function provided by OpenTTD, you don't have to
|
||||
* include it in your AI but should just call it from GetSettings.
|
||||
*/
|
||||
void AddLabels(const char *setting_name, table value_names);
|
||||
};
|
||||
#endif
|
@@ -21,7 +21,7 @@ if [ -z "$1" ]; then
|
||||
for f in `ls *.hpp`; do
|
||||
case "${f}" in
|
||||
# these files should not be changed by this script
|
||||
"ai_controller.hpp" | "ai_object.hpp" | "ai_types.hpp" | "ai_changelog.hpp" | "ai_info_docs.hpp" ) continue;
|
||||
"ai_controller.hpp" | "ai_object.hpp" | "ai_types.hpp" ) continue;
|
||||
esac
|
||||
${AWK} -f squirrel_export.awk ${f} > ${f}.tmp
|
||||
if ! [ -f "${f}.sq" ] || [ -n "`diff -I '$Id' ${f}.tmp ${f}.sq 2> /dev/null || echo boo`" ]; then
|
||||
|
@@ -1303,7 +1303,6 @@ static void CrashAirplane(Vehicle *v)
|
||||
CreateEffectVehicleRel(v, 4, 4, 8, EV_EXPLOSION_LARGE);
|
||||
|
||||
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
|
||||
v->MarkDirty();
|
||||
|
||||
uint amt = 2;
|
||||
if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) amt += v->cargo.Count();
|
||||
|
@@ -606,7 +606,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac
|
||||
assert(res.GetCost() == res2.GetCost() && CmdFailed(res) == CmdFailed(res2)); // sanity check
|
||||
} else {
|
||||
if (CmdFailed(res2)) {
|
||||
res2.SetGlobalErrorMessage();
|
||||
res.SetGlobalErrorMessage();
|
||||
goto show_error;
|
||||
}
|
||||
}
|
||||
|
@@ -59,14 +59,7 @@ Company::~Company()
|
||||
if (CleaningPool()) return;
|
||||
|
||||
DeleteCompanyWindows(this->index);
|
||||
|
||||
/* Zero the memory of the company; we might 'reuse' it later on.
|
||||
* This is more a hack than a proper fix, but... it's already
|
||||
* fixed in trunk by the new pool system and this is the only
|
||||
* troublesome case in 0.7, so we'll leave it at this fix. */
|
||||
CompanyID id = this->index;
|
||||
memset(this, 0, sizeof(*this));
|
||||
this->index = id;
|
||||
this->name_1 = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -264,9 +257,7 @@ static void GenerateCompanyName(Company *c)
|
||||
StringID str;
|
||||
Company *cc;
|
||||
uint32 strp;
|
||||
/* Reserve space for extra unicode character. We need to do this to be able
|
||||
* to detect too long company name. */
|
||||
char buffer[MAX_LENGTH_COMPANY_NAME_BYTES + MAX_CHAR_LENGTH];
|
||||
char buffer[100];
|
||||
|
||||
if (c->name_1 != STR_SV_UNNAMED) return;
|
||||
|
||||
@@ -398,9 +389,7 @@ restart:;
|
||||
c->president_name_2 = Random();
|
||||
c->president_name_1 = SPECSTR_PRESIDENT_NAME;
|
||||
|
||||
/* Reserve space for extra unicode character. We need to do this to be able
|
||||
* to detect too long president name. */
|
||||
char buffer[MAX_LENGTH_PRESIDENT_NAME_BYTES + MAX_CHAR_LENGTH];
|
||||
char buffer[MAX_LENGTH_PRESIDENT_NAME_BYTES + 1];
|
||||
SetDParam(0, c->index);
|
||||
GetString(buffer, STR_PRESIDENT_NAME, lastof(buffer));
|
||||
if (strlen(buffer) >= MAX_LENGTH_PRESIDENT_NAME_BYTES) continue;
|
||||
@@ -408,8 +397,7 @@ restart:;
|
||||
Company *cc;
|
||||
FOR_ALL_COMPANIES(cc) {
|
||||
if (c != cc) {
|
||||
/* Reserve extra space so even overlength president names can be compared. */
|
||||
char buffer2[MAX_LENGTH_PRESIDENT_NAME_BYTES + MAX_CHAR_LENGTH];
|
||||
char buffer2[MAX_LENGTH_PRESIDENT_NAME_BYTES + 2];
|
||||
SetDParam(0, cc->index);
|
||||
GetString(buffer2, STR_PRESIDENT_NAME, lastof(buffer2));
|
||||
if (strcmp(buffer2, buffer) == 0) goto restart;
|
||||
|
@@ -1153,7 +1153,7 @@ Money GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, C
|
||||
int result = GB(callback, 0, 14);
|
||||
|
||||
/* Simulate a 15 bit signed value */
|
||||
if (HasBit(callback, 14)) result -= 0x4000;
|
||||
if (HasBit(callback, 14)) result = 0x4000 - result;
|
||||
|
||||
/* "The result should be a signed multiplier that gets multiplied
|
||||
* by the amount of cargo moved and the price factor, then gets
|
||||
@@ -1563,6 +1563,9 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
|
||||
{
|
||||
assert(v->current_order.IsType(OT_LOADING));
|
||||
|
||||
/* When we've finished loading we're just staying here till the timetable 'runs' out */
|
||||
if (HasBit(v->vehicle_flags, VF_LOADING_FINISHED)) return;
|
||||
|
||||
assert(v->load_unload_time_rem != 0);
|
||||
|
||||
/* We have not waited enough time till the next round of loading/unloading */
|
||||
@@ -1584,7 +1587,6 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
|
||||
/* The train reversed in the station. Take the "easy" way
|
||||
* out and let the train just leave as it always did. */
|
||||
SetBit(v->vehicle_flags, VF_LOADING_FINISHED);
|
||||
v->load_unload_time_rem = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1678,11 +1680,9 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
|
||||
/* update stats */
|
||||
int t;
|
||||
switch (u->type) {
|
||||
case VEH_TRAIN: t = u->u.rail.cached_max_speed; break;
|
||||
case VEH_ROAD: t = u->max_speed / 2; break;
|
||||
case VEH_SHIP: t = u->max_speed; break;
|
||||
case VEH_AIRCRAFT: t = u->max_speed * 10 / 129; break; // convert to old units
|
||||
default: NOT_REACHED();
|
||||
case VEH_TRAIN: t = u->u.rail.cached_max_speed; break;
|
||||
case VEH_ROAD: t = u->max_speed / 2; break;
|
||||
default: t = u->max_speed; break;
|
||||
}
|
||||
|
||||
/* if last speed is 0, we treat that as if no vehicle has ever visited the station. */
|
||||
|
@@ -1597,7 +1597,6 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const Ind
|
||||
*/
|
||||
static Industry *CreateNewIndustryHelper(TileIndex tile, IndustryType type, DoCommandFlag flags, const IndustrySpec *indspec, uint itspec_index, uint32 seed, Owner founder)
|
||||
{
|
||||
assert(itspec_index < indspec->num_table);
|
||||
const IndustryTileTable *it = indspec->table[itspec_index];
|
||||
bool custom_shape_check = false;
|
||||
|
||||
@@ -1650,7 +1649,9 @@ CommandCost CmdBuildIndustry(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
const Industry *ind = NULL;
|
||||
|
||||
/* Check if the to-be built/founded industry is available for this climate. */
|
||||
if (!indspec->enabled || indspec->num_table == 0) return CMD_ERROR;
|
||||
if (!indspec->enabled) {
|
||||
return CMD_ERROR;
|
||||
}
|
||||
|
||||
/* If the setting for raw-material industries is not on, you cannot build raw-material industries.
|
||||
* Raw material industries are industries that do not accept cargo (at least for now) */
|
||||
@@ -1787,7 +1788,7 @@ void GenerateIndustries()
|
||||
}
|
||||
|
||||
chance = ind_spc->appear_creation[_settings_game.game_creation.landscape];
|
||||
if (ind_spc->enabled && chance > 0 && ind_spc->num_table > 0) {
|
||||
if (ind_spc->enabled && chance > 0) {
|
||||
/* once the chance of appearance is determind, it have to be scaled by
|
||||
* the difficulty level. The "chance" in question is more an index into
|
||||
* the _numof_industry_table,in fact */
|
||||
@@ -1810,7 +1811,7 @@ void GenerateIndustries()
|
||||
* @todo : Do we really have to pass chance as un-scaled value, since we've already
|
||||
* processed that scaling above? No, don't think so. Will find a way. */
|
||||
ind_spc = GetIndustrySpec(it);
|
||||
if (ind_spc->enabled && ind_spc->num_table > 0) {
|
||||
if (ind_spc->enabled) {
|
||||
chance = ind_spc->appear_creation[_settings_game.game_creation.landscape];
|
||||
if (chance > 0) PlaceInitialIndustry(it, chance);
|
||||
}
|
||||
@@ -1867,7 +1868,7 @@ static void MaybeNewIndustry(void)
|
||||
ind_spc = GetIndustrySpec(j);
|
||||
byte chance = ind_spc->appear_ingame[_settings_game.game_creation.landscape];
|
||||
|
||||
if (!ind_spc->enabled || chance == 0 || ind_spc->num_table == 0) continue;
|
||||
if (!ind_spc->enabled || chance == 0) continue;
|
||||
|
||||
/* If there is no Callback CBID_INDUSTRY_AVAILABLE or if this one did anot failed,
|
||||
* and if appearing chance for this landscape is above 0, this industry can be chosen */
|
||||
|
@@ -340,7 +340,7 @@ struct AboutWindow : public Window {
|
||||
"Special thanks go out to:",
|
||||
" Josef Drexler - For his great work on TTDPatch",
|
||||
" Marcin Grzegorczyk - For his documentation of TTD internals",
|
||||
" Petr Baudi\xC5\xA1 (pasky) - Many patches, newGRF support",
|
||||
" Petr Baudis (pasky) - Many patches, newGRF support",
|
||||
" Stefan Mei\xC3\x9Fner (sign_de) - For his work on the console",
|
||||
" Simon Sasburg (HackyKid) - Many bugfixes he has blessed us with",
|
||||
" Cian Duffy (MYOB) - BeOS port / manual writing",
|
||||
|
@@ -76,7 +76,5 @@ void CDECL NetworkAddChatMessage(TextColour colour, uint8 duration, const char *
|
||||
void NetworkUndrawChatMessage();
|
||||
void NetworkChatMessageDailyLoop();
|
||||
|
||||
void NetworkAfterNewGRFScan();
|
||||
|
||||
#endif /* ENABLE_NETWORK */
|
||||
#endif /* NETWORK_FUNC_H */
|
||||
|
@@ -150,37 +150,4 @@ void NetworkGameListRequery()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild the GRFConfig's of the servers in the game list as we did
|
||||
* a rescan and might have found new NewGRFs.
|
||||
*/
|
||||
void NetworkAfterNewGRFScan()
|
||||
{
|
||||
for (NetworkGameList *item = _network_game_list; item != NULL; item = item->next) {
|
||||
/* Reset compatability state */
|
||||
item->info.compatible = item->info.version_compatible;
|
||||
|
||||
for (GRFConfig *c = item->info.grfconfig; c != NULL; c = c->next) {
|
||||
assert(HasBit(c->flags, GCF_COPY));
|
||||
|
||||
const GRFConfig *f = FindGRFConfig(c->grfid, c->md5sum);
|
||||
if (f == NULL) {
|
||||
/* Don't know the GRF, so mark game incompatible and the (possibly)
|
||||
* already resolved name for this GRF (another server has sent the
|
||||
* name of the GRF already */
|
||||
c->name = FindUnknownGRFName(c->grfid, c->md5sum, true);
|
||||
c->status = GCS_NOT_FOUND;
|
||||
|
||||
/* If we miss a file, we're obviously incompatible */
|
||||
item->info.compatible = false;
|
||||
} else {
|
||||
c->filename = f->filename;
|
||||
c->name = f->name;
|
||||
c->info = f->info;
|
||||
c->status = GCS_UNKNOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
@@ -2173,25 +2173,6 @@ static ChangeInfoResult IndustrytilesChangeInfo(uint indtid, int numinfo, int pr
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the industry layout; e.g. to prevent duplicate tiles.
|
||||
* @param layout the layout to check
|
||||
* @param size the size of the layout
|
||||
* @return true if the layout is deemed valid
|
||||
*/
|
||||
static bool ValidateIndustryLayout(const IndustryTileTable *layout, int size)
|
||||
{
|
||||
for (int i = 0; i < size - 1; i++) {
|
||||
for (int j = i + 1; j < size; j++) {
|
||||
if (layout[i].ti.x == layout[j].ti.x &&
|
||||
layout[i].ti.y == layout[j].ti.y) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop, byte **bufp, int len)
|
||||
{
|
||||
byte *buf = *bufp;
|
||||
@@ -2323,16 +2304,8 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop,
|
||||
itt[k].ti.y = (int8)GB(itt[k].ti.y, 0, 8);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ValidateIndustryLayout(copy_from, size)) {
|
||||
/* The industry layout was not valid, so skip this one. */
|
||||
grfmsg(1, "IndustriesChangeInfo: Invalid industry layout for industry id %u. Ignoring", indid);
|
||||
indsp->num_table--;
|
||||
j--;
|
||||
} else {
|
||||
tile_table[j] = CallocT<IndustryTileTable>(size);
|
||||
memcpy(tile_table[j], copy_from, sizeof(*copy_from) * size);
|
||||
}
|
||||
tile_table[j] = CallocT<IndustryTileTable>(size);
|
||||
memcpy(tile_table[j], copy_from, sizeof(*copy_from) * size);
|
||||
}
|
||||
/* Install final layout construction in the industry spec */
|
||||
indsp->table = tile_table;
|
||||
|
@@ -9,7 +9,6 @@
|
||||
#include "string_func.h"
|
||||
#include "gamelog.h"
|
||||
#include "network/network_type.h"
|
||||
#include "network/network_func.h"
|
||||
#include "gfx_func.h"
|
||||
|
||||
#include "fileio_func.h"
|
||||
@@ -142,8 +141,6 @@ GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src, bool init_o
|
||||
if (src->error->custom_message != NULL) c->error->custom_message = strdup(src->error->custom_message);
|
||||
}
|
||||
|
||||
ClrBit(c->flags, GCF_COPY);
|
||||
|
||||
ClrBit(c->flags, GCF_INIT_ONLY);
|
||||
if (init_only) SetBit(c->flags, GCF_INIT_ONLY);
|
||||
|
||||
@@ -386,10 +383,6 @@ void ScanNewGRFFiles()
|
||||
_all_grfs = to_sort[0];
|
||||
|
||||
free(to_sort);
|
||||
|
||||
#ifdef ENABLE_NETWORK
|
||||
NetworkAfterNewGRFScan();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@@ -133,9 +133,8 @@ struct NewGRFAddWindow : public Window {
|
||||
GRFConfig **list;
|
||||
const GRFConfig *sel;
|
||||
|
||||
NewGRFAddWindow(const WindowDesc *desc, Window *parent, GRFConfig **list) : Window(desc, 0)
|
||||
NewGRFAddWindow(const WindowDesc *desc, GRFConfig **list) : Window(desc, 0)
|
||||
{
|
||||
this->parent = parent;
|
||||
this->list = list;
|
||||
this->resize.step_height = 10;
|
||||
|
||||
@@ -491,7 +490,7 @@ struct NewGRFWindow : public Window {
|
||||
|
||||
case SNGRFS_ADD: // Add GRF
|
||||
DeleteWindowByClass(WC_SAVELOAD);
|
||||
new NewGRFAddWindow(&_newgrf_add_dlg_desc, this, &this->list);
|
||||
new NewGRFAddWindow(&_newgrf_add_dlg_desc, &this->list);
|
||||
break;
|
||||
|
||||
case SNGRFS_REMOVE: { // Remove GRF
|
||||
|
@@ -64,8 +64,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,7,3,17678
|
||||
PRODUCTVERSION 0,7,3,17678
|
||||
FILEVERSION 0,7,3,17520
|
||||
PRODUCTVERSION 0,7,3,17520
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -83,14 +83,14 @@ BEGIN
|
||||
VALUE "Comments", "This program is licensed under the GNU General Public License.\0"
|
||||
VALUE "CompanyName", "OpenTTD Development Team\0"
|
||||
VALUE "FileDescription", "OpenTTD\0"
|
||||
VALUE "FileVersion", "0.7.3\0"
|
||||
VALUE "FileVersion", "0.7.3-RC1\0"
|
||||
VALUE "InternalName", "openttd\0"
|
||||
VALUE "LegalCopyright", "Copyright \xA9 OpenTTD Developers 2002-2009. All Rights Reserved.\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "openttd.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "OpenTTD\0"
|
||||
VALUE "ProductVersion", "0.7.3\0"
|
||||
VALUE "ProductVersion", "0.7.3-RC1\0"
|
||||
VALUE "SpecialBuild", "-\0"
|
||||
END
|
||||
END
|
||||
|
@@ -20,7 +20,7 @@
|
||||
* norev000 is for non-releases that are made on systems without
|
||||
* subversion or sources that are not a checkout of subversion.
|
||||
*/
|
||||
const char _openttd_revision[] = "0.7.3";
|
||||
const char _openttd_revision[] = "0.7.3-RC1";
|
||||
|
||||
/**
|
||||
* Let us know if current build was modified. This detection
|
||||
@@ -45,11 +45,11 @@ const byte _openttd_revision_modified = !!MODIFIED!!;
|
||||
* final release will always have a lower version number than the released
|
||||
* version, thus making comparisions on specific revisions easy.
|
||||
*/
|
||||
const uint32 _openttd_newgrf_version = 0 << 28 | 7 << 24 | 3 << 20 | 1 << 19 | (17678 & ((1 << 19) - 1));
|
||||
const uint32 _openttd_newgrf_version = 0 << 28 | 7 << 24 | 3 << 20 | 0 << 19 | (17520 & ((1 << 19) - 1));
|
||||
|
||||
#ifdef __MORPHOS__
|
||||
/**
|
||||
* Variable used by MorphOS to show the version.
|
||||
*/
|
||||
extern const char morphos_versions_tag[] = "$VER: OpenTTD 0.7.3 (!!DATE!!) OpenTTD Team [MorphOS, PowerPC]";
|
||||
extern const char morphos_versions_tag[] = "$VER: OpenTTD 0.7.3-RC1 (!!DATE!!) OpenTTD Team [MorphOS, PowerPC]";
|
||||
#endif
|
||||
|
@@ -651,7 +651,6 @@ static void HandleBrokenRoadVeh(Vehicle *v)
|
||||
|
||||
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
|
||||
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
||||
v->MarkDirty();
|
||||
|
||||
if (!PlayVehicleSound(v, VSE_BREAKDOWN)) {
|
||||
SndPlayVehicleFx((_settings_game.game_creation.landscape != LT_TOYLAND) ?
|
||||
@@ -668,7 +667,6 @@ static void HandleBrokenRoadVeh(Vehicle *v)
|
||||
if (--v->breakdown_delay == 0) {
|
||||
v->breakdown_ctr = 0;
|
||||
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
|
||||
v->MarkDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -466,7 +466,7 @@ static SQInteger _io_file_read(SQUserPointer file, SQUserPointer buf, SQInteger
|
||||
/* Load and run the script */
|
||||
if (SQ_SUCCEEDED(LoadFile(vm, script, SQTrue))) {
|
||||
sq_push(vm, -2);
|
||||
if (SQ_SUCCEEDED(sq_call(vm, 1, SQFalse, SQTrue, 100000))) {
|
||||
if (SQ_SUCCEEDED(sq_call(vm, 1, SQFalse, SQTrue))) {
|
||||
sq_pop(vm, 1);
|
||||
return true;
|
||||
}
|
||||
|
@@ -551,9 +551,6 @@ public:
|
||||
GameSettings *opt_ptr = (_game_mode == GM_MENU) ? &_settings_newgame : &_settings_game;
|
||||
|
||||
uint i;
|
||||
GetSettingFromName("difficulty.diff_level", &i);
|
||||
DoCommandP(0, i, this->opt_mod_temp.difficulty.diff_level, CMD_CHANGE_SETTING);
|
||||
|
||||
const SettingDesc *sd = GetSettingFromName("difficulty.max_no_competitors", &i);
|
||||
for (uint btn = 0; btn != GAME_DIFFICULTY_NUM; btn++, sd++) {
|
||||
int32 new_val = (int32)ReadValue(GetVariableAddress(&this->opt_mod_temp, &sd->save), sd->save.conv);
|
||||
@@ -563,6 +560,9 @@ public:
|
||||
DoCommandP(0, i + btn, new_val, CMD_CHANGE_SETTING);
|
||||
}
|
||||
}
|
||||
|
||||
GetSettingFromName("difficulty.diff_level", &i);
|
||||
DoCommandP(0, i, this->opt_mod_temp.difficulty.diff_level, CMD_CHANGE_SETTING);
|
||||
delete this;
|
||||
/* If we are in the editor, we should reload the economy.
|
||||
* This way when you load a game, the max loan and interest rate
|
||||
|
@@ -189,7 +189,6 @@ static void HandleBrokenShip(Vehicle *v)
|
||||
|
||||
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
|
||||
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
||||
v->MarkDirty();
|
||||
|
||||
if (!PlayVehicleSound(v, VSE_BREAKDOWN)) {
|
||||
SndPlayVehicleFx((_settings_game.game_creation.landscape != LT_TOYLAND) ?
|
||||
@@ -206,7 +205,6 @@ static void HandleBrokenShip(Vehicle *v)
|
||||
if (!--v->breakdown_delay) {
|
||||
v->breakdown_ctr = 0;
|
||||
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
|
||||
v->MarkDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
typedef uint16 StringID;
|
||||
static const StringID INVALID_STRING_ID = 0xFFFF; ///< Constant representing an invalid string
|
||||
static const int MAX_CHAR_LENGTH = 4; ///< Max. length of UTF-8 encoded unicode character
|
||||
|
||||
enum {
|
||||
MAX_LANG = 64, ///< Maximal number of languages supported by the game
|
||||
|
@@ -1386,10 +1386,9 @@ struct TownNameParams {
|
||||
*/
|
||||
static bool VerifyTownName(uint32 r, const TownNameParams *par)
|
||||
{
|
||||
/* Reserve space for extra unicode character. We need to do this to be able
|
||||
* to detect too long town name. */
|
||||
char buf1[MAX_LENGTH_TOWN_NAME_BYTES + MAX_CHAR_LENGTH];
|
||||
char buf2[MAX_LENGTH_TOWN_NAME_BYTES + MAX_CHAR_LENGTH];
|
||||
/* reserve space for extra unicode character and terminating '\0' */
|
||||
char buf1[MAX_LENGTH_TOWN_NAME_BYTES + 4 + 1];
|
||||
char buf2[MAX_LENGTH_TOWN_NAME_BYTES + 4 + 1];
|
||||
|
||||
SetDParam(0, r);
|
||||
if (par->grf && par->grfid != 0) {
|
||||
|
@@ -1061,15 +1061,6 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
||||
if (dst_len < 0) return_cmd_error(STR_881A_TRAINS_CAN_ONLY_BE_ALTERED);
|
||||
}
|
||||
|
||||
if (src_head == src && !HasBit(p2, 0)) {
|
||||
/* Moving of a *single* vehicle at the front of the train.
|
||||
* If the next vehicle is an engine a new train will be created
|
||||
* instead of removing a vehicle from a free chain. The newly
|
||||
* created train may not be too long. */
|
||||
const Vehicle *u = GetNextVehicle(src_head);
|
||||
if (u != NULL && IsTrainEngine(u) && (src_len - 1) > max_len) return_cmd_error(STR_8819_TRAIN_TOO_LONG);
|
||||
}
|
||||
|
||||
/* We are moving between rows, so only count the wagons from the source
|
||||
* row that are being moved. */
|
||||
if (HasBit(p2, 0)) {
|
||||
@@ -4057,7 +4048,6 @@ static void HandleBrokenTrain(Vehicle *v)
|
||||
|
||||
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
|
||||
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
||||
v->MarkDirty();
|
||||
|
||||
if (!PlayVehicleSound(v, VSE_BREAKDOWN)) {
|
||||
SndPlayVehicleFx((_settings_game.game_creation.landscape != LT_TOYLAND) ?
|
||||
@@ -4074,7 +4064,6 @@ static void HandleBrokenTrain(Vehicle *v)
|
||||
if (!--v->breakdown_delay) {
|
||||
v->breakdown_ctr = 0;
|
||||
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
|
||||
v->MarkDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1734,7 +1734,6 @@ void StopAllVehicles()
|
||||
v->vehstatus |= VS_STOPPED;
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
v->MarkDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -115,7 +115,6 @@ CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||
InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
|
||||
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||
InvalidateWindowClasses(vehicle_list[v->type]);
|
||||
v->MarkDirty();
|
||||
}
|
||||
return CommandCost();
|
||||
}
|
||||
|
Reference in New Issue
Block a user