1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-31 18:39:10 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
rubidium
409a02e8f4 (svn r21615) -Release: 1.1.0-beta1 2010-12-23 23:00:01 +00:00
453 changed files with 8921 additions and 10704 deletions

View File

@@ -256,9 +256,9 @@ ifeq ($(OS), PSP)
# Because of a bug in the PSP GCC tools, linking via CXX results
# in total chaos and more problems then you can handle. So we need
# CC to link OpenTTD for PSP
$(Q)+$(CC_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
$(Q)$(CC_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
else
$(Q)+$(CXX_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
$(Q)$(CXX_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
endif
ifdef STRIP
$(Q)$(STRIP) $@

View File

@@ -319,5 +319,3 @@ AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
AIAbstractList <- AIList;
AIList.ChangeItem <- AIList.SetValue;
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;

View File

@@ -70,5 +70,3 @@ AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
AIAbstractList <- AIList;
AIList.ChangeItem <- AIList.SetValue;
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;

View File

@@ -15,6 +15,3 @@ regression =
[vehicle]
road_side = right
plane_speed = 2
[construction]
max_bridge_length = 100

View File

@@ -1028,7 +1028,6 @@ function Regression::RailTypeList()
print(" ListDump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" RailType: " + i);
print(" GetName(): " + AIRail.GetName(i));
print(" IsRailTypeAvailable(): " + AIRail.IsRailTypeAvailable(i));
print(" GetMaxSpeed(): " + AIRail.GetMaxSpeed(i));
}
@@ -1478,7 +1477,6 @@ function Regression::Town()
print(" GetLocation(): " + AITown.GetLocation(i));
print(" GetHouseCount(): " + AITown.GetHouseCount(i));
print(" GetRating(): " + AITown.GetRating(i, AICompany.COMPANY_SELF));
print(" IsCity(): " + AITown.IsCity(i));
}
print(" Valid Towns: " + j);
print(" GetTownCount(): " + AITown.GetTownCount());

View File

@@ -7209,7 +7209,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
Count(): 1
ListDump:
RailType: 0
GetName(): Railway construction
IsRailTypeAvailable(): true
GetMaxSpeed(): 0
@@ -7981,7 +7980,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 15508
GetHouseCount(): 30
GetRating(): 0
IsCity(): true
Town 1
IsValidTown(): true
GetName(): Trenningville
@@ -7989,7 +7987,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 46751
GetHouseCount(): 17
GetRating(): 0
IsCity(): false
Town 2
IsValidTown(): true
GetName(): Tonston
@@ -7997,7 +7994,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 28365
GetHouseCount(): 19
GetRating(): 0
IsCity(): false
Town 3
IsValidTown(): true
GetName(): Tunford
@@ -8005,7 +8001,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 41895
GetHouseCount(): 11
GetRating(): 0
IsCity(): false
Town 4
IsValidTown(): true
GetName(): Wruntown
@@ -8013,7 +8008,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 41450
GetHouseCount(): 18
GetRating(): 0
IsCity(): true
Town 5
IsValidTown(): true
GetName(): Fratston
@@ -8021,7 +8015,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 55007
GetHouseCount(): 11
GetRating(): 0
IsCity(): false
Town 6
IsValidTown(): true
GetName(): Muningville
@@ -8029,7 +8022,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 38200
GetHouseCount(): 28
GetRating(): 0
IsCity(): false
Town 7
IsValidTown(): true
GetName(): Hutford
@@ -8037,7 +8029,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 59234
GetHouseCount(): 33
GetRating(): 0
IsCity(): false
Town 8
IsValidTown(): true
GetName(): Satown
@@ -8045,7 +8036,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 51267
GetHouseCount(): 20
GetRating(): 0
IsCity(): true
Town 9
IsValidTown(): true
GetName(): Frindinghattan
@@ -8053,7 +8043,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 5825
GetHouseCount(): 18
GetRating(): 0
IsCity(): false
Town 10
IsValidTown(): true
GetName(): Nuntburg
@@ -8061,7 +8050,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 6446
GetHouseCount(): 26
GetRating(): 6
IsCity(): false
Town 11
IsValidTown(): true
GetName(): Fort Frindston
@@ -8069,7 +8057,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 14935
GetHouseCount(): 13
GetRating(): 0
IsCity(): false
Town 12
IsValidTown(): true
GetName(): Gintborough
@@ -8077,7 +8064,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 32740
GetHouseCount(): 28
GetRating(): 0
IsCity(): true
Town 13
IsValidTown(): true
GetName(): Great Hinninghall
@@ -8085,7 +8071,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 9595
GetHouseCount(): 14
GetRating(): 0
IsCity(): false
Town 14
IsValidTown(): true
GetName(): Prundinghall
@@ -8093,7 +8078,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 51298
GetHouseCount(): 18
GetRating(): 0
IsCity(): false
Town 15
IsValidTown(): true
GetName(): Beningville
@@ -8101,7 +8085,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 42338
GetHouseCount(): 33
GetRating(): 6
IsCity(): false
Town 16
IsValidTown(): true
GetName(): Kennville
@@ -8109,7 +8092,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 17345
GetHouseCount(): 33
GetRating(): 0
IsCity(): true
Town 17
IsValidTown(): true
GetName(): Quarfingfield
@@ -8117,7 +8099,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 24252
GetHouseCount(): 13
GetRating(): 0
IsCity(): false
Town 18
IsValidTown(): true
GetName(): Nefingbridge
@@ -8125,7 +8106,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 10574
GetHouseCount(): 13
GetRating(): 0
IsCity(): false
Town 19
IsValidTown(): true
GetName(): Mendston
@@ -8133,7 +8113,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 6511
GetHouseCount(): 14
GetRating(): 0
IsCity(): false
Town 20
IsValidTown(): true
GetName(): Chenfingbourne
@@ -8141,7 +8120,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 22585
GetHouseCount(): 15
GetRating(): 6
IsCity(): true
Town 21
IsValidTown(): true
GetName(): Franinghead
@@ -8149,7 +8127,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 9634
GetHouseCount(): 27
GetRating(): 0
IsCity(): false
Town 22
IsValidTown(): true
GetName(): Natborough
@@ -8157,7 +8134,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 51891
GetHouseCount(): 12
GetRating(): 0
IsCity(): false
Town 23
IsValidTown(): true
GetName(): Larborough
@@ -8165,7 +8141,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 59622
GetHouseCount(): 27
GetRating(): 0
IsCity(): false
Town 24
IsValidTown(): true
GetName(): Little Frutford
@@ -8173,7 +8148,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 19596
GetHouseCount(): 34
GetRating(): 4
IsCity(): true
Town 25
IsValidTown(): true
GetName(): Grinnway
@@ -8181,7 +8155,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 16433
GetHouseCount(): 15
GetRating(): 0
IsCity(): false
Town 26
IsValidTown(): true
GetName(): Beburg
@@ -8189,7 +8162,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 39505
GetHouseCount(): 18
GetRating(): 0
IsCity(): false
Town 27
IsValidTown(): true
GetName(): Fudhattan
@@ -8197,7 +8169,6 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetLocation(): 45525
GetHouseCount(): 19
GetRating(): 0
IsCity(): false
Valid Towns: 28
GetTownCount(): 28

View File

@@ -25,7 +25,7 @@ fi
if [ -n "$gdb" ]; then
$gdb ./openttd -x -c ai/regression/regression.cfg $params -g ai/regression/regression.sav
else
./openttd -x -c ai/regression/regression.cfg $params -g ai/regression/regression.sav -d ai=2 2>&1 | awk '{ gsub("0x(\\(nil\\)|0+)(x0)?", "0x00000000", $0); gsub("^dbg: \\[ai\\]", "", $0); gsub("^ ", "ERROR: ", $0); gsub("ERROR: \\[1\\] ", "", $0); gsub("\\[P\\] ", "", $0); print $0; }' > tmp.regression
./openttd -x -c ai/regression/regression.cfg $params -g ai/regression/regression.sav -d ai=2 2>&1 | awk '{ gsub("0x(\\(nil\\)|0+)", "0x00000000", $0); gsub("^dbg: \\[ai\\]", "", $0); gsub("^ ", "ERROR: ", $0); gsub("ERROR: \\[1\\] ", "", $0); gsub("\\[P\\] ", "", $0); print $0; }' > tmp.regression
fi
if [ -z "$gdb" ]; then

View File

@@ -1,124 +1,3 @@
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)
- Feature: Show a list of companies in the owner legend and allow them to be toggled for visibility (r21720, r21718)
- Feature: Console command 'list_ai_libs' to get a list of recognized AI libraries [FS#4372] (r21703)
- Feature: Allow changing the AI configuration in the scenario editor / in game [FS#4362] (r21696)
- Change: Tune 'realistic' acceleration even more to make more trains reach their top speed, and make it behave more like TTDPatch (r21712)
- Change: Display the minimum height of the tile in the LandInfo window instead of the height of the northern corner. So it is more useful for NewGRF and AI developers, and maybe more transparent for players (r21711)
- Fix: The diagonal iterator would iterate twice over some tiles [FS#4395] (r21747)
- Fix: [NewGRF] Canal variable 83 accessed water random bits also for non-water tiles (e.g. watery industries or objects) (r21746)
- Fix: [NewGRF] Canal variable 80 shall return consistent heights within a lock (r21745)
- Fix: Allow Ctrl+Clicking automatic orders for scrolling to their destination (r21744)
- Fix: Coast tiles were not drawn under bridges [FS#4386] (r21743)
- Fix: Make clearing refit orders work again [FS#4388] (r21739)
- Fix: Start loading when cur_order_index points to the destination station, i.e. after deleting not-reached automatic orders [FS#4384] (r21738)
- Fix: A loading order was also marked as 'not part of orders' when the order before the current order was deleted (r21737)
- Fix: Admin bots were not always notified of password changes [FS#4377] (r21727)
- Fix: Vehicle sprite was cached into a 16 bit variable, causing incorrect sprites to be displayed (r21709)
- Fix: [NewGRF] Report TTDPatch flag 4A (newobjects) as set (r21708)
- Fix: The old ship pathfinder is too stupid to provide 'lost' notices; it would even get lost while following its own path [FS#4370] (r21706)
- Fix: Do not perform any more checks after the connection is closed [FS#4374] (r21704)
- Fix: Changing AI settings ingame was impossible when the difficulty level was other than custom (r21694)
- Fix: Due to an error in the Debian changelog building of Debian/Ubuntu packages failed (r21682)
1.1.0-beta2 (2010-12-31)
------------------------------------------------------------------------
- Feature: Command logging using the admin interface (r21668)
- Feature: Concept of automatic station orders; add stub orders for intermediate stations and remove them when not visiting them anymore. This allows you to see what trains visit a station without actually having to order a vehicle to stop at all stations (r21642)
- Add: [NoAI] AIEventTownFounded (r21664)
- Add: [NoAI] AIRail::GetName() to get the name of a railtype (r21663)
- Add: [NoAI] AITown::IsCity() so AIs can find out which towns grow faster than others (r21654)
- Change: Do not show price to build a bridge in the scenario editor as they are free to build there [FS#4358] (r21673)
- Change: Do not highlight tile when selecting a vehicle to clone or an order to skip to (r21616)
- Fix: Estonia introduced the Euro in 2011 (r21670)
- Fix: Autofill timetable had side effects in test mode, possibly causing desyncs in MP [FS#4354] (r21660)
- Fix: Cargo payment graph was not properly invalidated when payment rate changed [FS#4351] (r21658)
- Fix: Use a bool instead of uint8 to store a bool and use the dedicated accessor function when reading boolean settings [FS#4345] (r21656)
- Fix: Infinite loop in the road pathfinder due to bouncing around in an 'one way' trap; two one ways pointing towards eachother making it impossible to leave [FS#4338] (r21651)
- Fix: Make '[centre|main] view' consistent, and make '[main|global] view' consistent [FS#4339] (r21650)
- Fix: Newly created skip-to order was created at wrong place (r21633)
- Fix: Ships with the old pathfinder would easily show up as lost, even when it would eventually find a path. Now also the distance from the 'end' of the pathfinding run to the destination is compared to the current distance to the destination; if the distance to the destination at the end of the pathfinder run is less than the current distance from the destination the ship will not be marked as lost. This means that the ships with the old pathfinder will less likely get marked as lost, but due to the design of the old ship pathfinder there 'lostness' is merely a best guess. When you still get a lost message you need to build buoys to guide the ship pathfinder [FS#4325] (r21631)
- Fix: Version detection of subversion branches and tags got broken (r21630)
- Fix: Crash under certain circumstances when using autorail [FS#4327] (r21619)
1.1.0-beta1 (2010-12-24)
------------------------------------------------------------------------
- Feature: [NewGRF] Variable 7B for accessing 60+x variables while taking the parameter from the accumulator (r21604)
@@ -407,7 +286,7 @@
- Fix: Road vehicles could be dead locked with one way roads. This allows one wayness to be removed if there are vehicles on a tile; it does not allow you to add one wayness to roads that have vehicles on them as it makes turning vehicles jump [FS#3961] (r20230)
- Fix: 'Service at nearest depot' behaved the same as 'Go to nearest depot' [FS#3986] (r20229)
- Fix: Depot did not become unsnowy, when snowline rises [FS#3976] (r20224)
- Fix: Strip non-printable characters before showing it in an edit box, so when renaming a vehicle type you will not get the 'SETX stuff' that some NewGRFs use [FS#3974] (r20220)
- Fix: Strip non-printable characters before showing it in an edit box, so when renaming a vehicle type you won't get the 'SETX stuff' that some NewGRFs use [FS#3974] (r20220)
- Fix: NewGRFs that defined a vehicle without either loaded or loading groups could crash OpenTTD [FS#3964] (r20199)
- Fix: [NewGRF] GetNearbyTileInformation can be used to get the terrain type of a MP_VOID tile [FS#3963] (r20197)
- Fix: [NewGRF] Vehicle var FE bit 6 did return incorrect values for new railtypes (r20175)
@@ -416,7 +295,7 @@
1.0.3 (2010-08-01)
------------------------------------------------------------------------
- Fix: Make it possible to properly assess the length of the rail toolbar caption, do not require '{WHITE}' control codes (r20242)
- Fix: Make it possible to properly assess the length of the rail toolbar caption, don't require '{WHITE}' control codes (r20242)
- Fix: Check for disallowed level crossings also when converting rail (r20237)
- Fix: Haiku uses a 'special' location for headers (r20219)
- Fix: Desync due to (temporary) wrong railtype; when loading a savegame the railtype of some (high ID) trains could be wrong [FS#3945] (r20137)
@@ -899,7 +778,7 @@
- Fix: Do not try to overtake a vehicle in a road station as overtaking in a station is not allowed [FS#3390] (r18561)
- Fix: Make aircraft behave the same on autoreplace/autorenew as other vehicle types (r18553)
- Fix: First do the time-since-last-service check and only then determine whether autoreplace needs to take place. This way they will not keep autoreplacing continuously on failure, but only after some timeout. Also check some minimal requirements (engine availability, refittability) and a heuristic for the needed money when sending vehicles for autoreplace [FS#1762] (r18551, r18549)
- Fix: Do not account for path reservation costs when entering a signal block via a 'block' signal. This way you will not get double penalties, both red signals and reservation costs, for the block signalled tracks [FS#2722] (r18535)
- Fix: Do not account for path reservation costs when entering a signal block via a 'block' signal. This way you won't get double penalties, both red signals and reservation costs, for the block signalled tracks [FS#2722] (r18535)
- Fix: [NewGRF] An industry NewGRF that defined a too small size for action0 prop 0A could cause a crash (r18527)
- Fix: Allegro does not like to work with extmidi, so warn the user about that [FS#3272] (r18520)
- Fix: When you pass a signal at danger, in a PBS controlled area, do not try to do the 'safe' thing and stop, but continue going; the user wanted the train to pass the signal at danger so (s)he has to suffer the consequences. Ofcourse one can always stop the train manually [FS#2891] (r18515)
@@ -912,7 +791,7 @@
- Fix: Unselect an AI in the AI Settings window when it falls out of the range of active AIs [FS#3357] (r18436)
- Fix: Road vehicles would not pick an empty drive through stop. Now they will *if* the penalty for driving around is less than the occupancy penalty [FS#1944] (r18404)
- Fix: Long (articulated) road vehicles could block loading of others when the following road vehicle already got 'permission' to go to the next bay even when it could not reach it [FS#1495] (r18404)
- Fix: The tree 'which one to draw' hash was not anywhere near random and thus showed a very visible repeated pattern when only one tree type was used [FS#3343] (r18398)
- Fix: The tree 'which one to draw' hash wasn't anywhere near random and thus showed a very visible repeated pattern when only one tree type was used [FS#3343] (r18398)
- Fix: [NoAI] Make AIIndustryType::GetConstructionCost() return -1, if the industry is neither buildable nor prospectable (r18276)
- Fix: Use free type ascender/descender metrics to position font offset correctly (r18096)
- Fix: Make the 'pause' chat message when actually executing the pause command. This to prevent showing paused and especially unpaused to be shown when the state does not change. Output now mentions whether pause changes keep the game paused and what reasons for pausing there 'currently' are (r18052)
@@ -2421,7 +2300,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: Buoys are now built and numbered 1..9 not 9..1 [FS#538] (r8123)
- Fix: Bouys 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)

View File

@@ -1295,12 +1295,7 @@ make_compiler_cflags() {
has_lto=`$1 -dumpspecs | grep '\%{flto'`
if [ -n "$has_lto" ]; then
# Use LTO only if we see LTO exists and is requested
if [ $cc_version -lt 46 ]; then
flags="$flags -flto"
else
flags="$flags -flto=jobserver"
fi
ldflags="$ldflags -fwhole-program"
flags="$flags -flto"
features="$features lto"
fi
fi
@@ -1663,8 +1658,8 @@ make_cflags_and_ldflags() {
fi
fi
if [ "$have_non_const_iconv" != "no" ]; then
CFLAGS="$CFLAGS -DHAVE_NON_CONST_ICONV"
if [ "$have_broken_iconv" != "no" ]; then
CFLAGS="$CFLAGS -DHAVE_BROKEN_ICONV"
fi
fi
@@ -2921,9 +2916,9 @@ detect_iconv() {
log 1 "checking iconv... found"
# There are different implementations of iconv. The older ones,
# e.g. SUSv2, pass a const pointer, whereas the newer ones, e.g.
# IEEE 1003.1 (2004), pass a non-const pointer.
# Check if we need to work around buggy iconv implementation where inbuf
# is wrongly typed as non-const. Correct implementation is at
# http://www.opengroup.org/onlinepubs/007908799/xsh/iconv.html
cat > tmp.iconv.cpp << EOF
#include "src/stdafx.h"
@@ -2943,8 +2938,8 @@ EOF
ret=$?
log 2 "executing $execute"
log 2 " exit code $ret"
if [ "$ret" = "0" ]; then have_non_const_iconv="no"; else have_non_const_iconv="yes"; fi
log 1 "checking if iconv has non-const inbuf... $have_non_const_iconv"
if [ "$ret" = "0" ]; then have_broken_iconv="no"; else have_broken_iconv="yes"; fi
log 1 "checking if iconv has non-const inbuf... $have_broken_iconv"
cat > tmp.iconv.cpp << EOF
#include "src/stdafx.h"
@@ -3254,13 +3249,13 @@ generate_src_osx() {
# We don't want to duplicate the x86_64 stuff for each target, so do it once here
if [ "$type" = "ppc64" ] || [ "$type" = "x86_64" ]; then
# 64 bits is always 10.5 or higher. Furthermore it has a non const ICONV
# 64 bits is always 10.5 or higher. Furthermore it has a broken ICONV
# and they also removed support for QuickTime/QuickDraw
if [ -n "$osx_sdk_path" ]; then
CFLAGS="-isysroot $osx_sdk_path $CFLAGS_orig"
LDFLAGS="-Wl,-syslibroot,$osx_sdk_path $LDFLAGS_orig"
fi
CFLAGS="$CFLAGS -D_SQ64 -DHAVE_NON_CONST_ICONV -DNO_QUICKTIME -UENABLE_COCOA_QUICKDRAW"
CFLAGS="$CFLAGS -D_SQ64 -DHAVE_BROKEN_ICONV -DNO_QUICKTIME -UENABLE_COCOA_QUICKDRAW"
LIBS="`echo $LIBS | sed 's/-framework QuickTime//'`"
fi

View File

@@ -1,24 +1,15 @@
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).
2.0) The format
---- ----------
The Format
----------
32bpp images are stored in PNG. They should go in:
data/sprites/<grfname>/<SpriteID>.png
@@ -42,3 +33,4 @@ 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.

View File

@@ -1,17 +1,5 @@
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
---- ------------
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
@@ -26,8 +14,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.
1.1) Examples
---- --------
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
@@ -47,8 +35,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.
1.2) strgen command switches
---- -----------------------
STRGEN COMMAND SWITCHES
-----------------------
-v | --version
strgen will tell what svn revision it was last modified

View File

@@ -1,23 +1,19 @@
OpenTTD's admin network
Last updated: 2011-01-20
------------------------------------------------------------------------
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
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
Preface
----------
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.
@@ -37,14 +33,12 @@ Table of contents
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 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
ADMIN_PACKET_SERVER_PROTOCOL in section 1.
2.0) Joining the network
---- -------------------
1. Joining the network
----------------------
Create a TCP connection to the server on port 3977. The application is
expected to authenticate within 10 seconds.
@@ -74,8 +68,9 @@ Table of contents
However, ADMIN_PACKET_SERVER_WELCOME only after a ADMIN_PACKET_SERVER_NEWGAME
3.0) Asking for updates
---- ------------------
2. 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.
@@ -118,18 +113,15 @@ Table of contents
- ADMIN_PACKET_SERVER_CONSOLE
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
- ADMIN_UPDATE_COMPANY_INFO
- ADMIN_UPDATE_COMPANY_ECONOMY
- ADMIN_UPDATE_COMPANY_STATS
- ADMIN_UPDATE_CMD_NAMES
ADMIN_UPDATE_CLIENT_INFO and ADMIN_UPDATE_COMPANY_INFO accept an additional
parameter. This parameter is used to specify a certain client or company.
@@ -142,8 +134,9 @@ Table of contents
Additional debug information can be found with a debug level of net=3.
4.0) Sending rcon commands
---- ---------------------
4. 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.
@@ -161,8 +154,9 @@ Table of contents
was not sent from the admin network.
5.0) Sending chat
---- ------------
5. Sending Chat
---------------
Sending a ADMIN_PACKET_ADMIN_CHAT results in chat originating from the server.
Currently four types of chat are supported:
@@ -175,8 +169,10 @@ Table of contents
using the respective DestType and ID.
This is a message prefixed with the 3 stars, e.g. *** foo has joined the game
5.1) Receiving chat
---- -------------
6. 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,14 +180,16 @@ Table of contents
private chat for to the server is distributed into the admin network.
6.0) Disconnecting
---- -------------
7. Disconnecting
----------------
It is a kind thing to say good bye before leaving. Do this by sending the
ADMIN_PACKET_ADMIN_QUIT packet.
7.0) Certain packet information
---- --------------------------
8. Certain packet information
-----------------------------
All ADMIN_PACKET_SERVER_* packets have an enum value greater 100.
ADMIN_PACKET_SERVER_WELCOME
@@ -204,8 +202,4 @@ Table of contents
a CLIENT_JOIN / COMPANY_NEW packet without having received the INFO packet
it may be a good idea to POLL for the specific ID.
ADMIN_PACKET_SERVER_CMD_NAMES and ADMIN_PACKET_SERVER_CMD_LOGGING
Data provided with these packets is not stable and will not be
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.

View File

@@ -1,22 +1,9 @@
Multiplayer manual for OpenTTD
Last updated: 2011-01-20
------------------------------------------------------------------------
Multiplayer Manual for OpenTTD
==============================
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
@@ -27,8 +14,9 @@ Table of contents
- Start playing
2.0) Connecting to a server
---- ----------------------
2. 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
@@ -55,14 +43,17 @@ Table of contents
- Happy playing
2.1) Connecting to a server over the console
---- ---------------------------------------
3. Connecting to a Server over the Console
-------------------------------------------
- Open the console and type in the following command:
connect <ip/host>:<port>#<company-no>
3.0) Playing internet games
---- ----------------------
4. 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.
@@ -92,8 +83,9 @@ Table of contents
NB: changing frame_freq has more effect on the bandwidth then sync_freq.
4.0) Tips for servers
---- ----------------
5. 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.
@@ -149,49 +141,10 @@ Table of contents
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
- 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.
6. Some useful things
----------------------
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
@@ -203,8 +156,9 @@ Table of contents
- Servers can now kick players, so don't make them use it!
6.0) Troubleshooting
---- ---------------
7. 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

View File

@@ -1,6 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.\" Please adjust this date whenever revising the manpage.
.Dd Dec 31, 2010
.Dd Apr 01, 2010
.Dt OPENTTD 6
.Sh NAME
.Nm openttd

View File

@@ -93,17 +93,12 @@ 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
@@ -111,17 +106,8 @@ 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$@@'`"
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
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@"`
elif [ -f "$ROOT_DIR/.ottdrev" ]; then
# We are an exported source bundle
cat $ROOT_DIR/.ottdrev

View File

@@ -1,18 +1,18 @@
OpenTTD's known bugs
Last updated: 2011-02-04
Release version: 1.1.0-beta5
Last updated: 2010-12-24
Release version: 1.1.0-beta1
------------------------------------------------------------------------
Table of contents
-----------------
1.0) About
2.0) Known bugs in this release
* 2.1) Known bugs that will not be solved
Table of Contents:
------------------
1) About
2) Known bugs in the this stable release
3) Known bugs that will not be solved
1.0) About
---- -----
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!!
@@ -22,12 +22,12 @@ specifics, we welcome you to report them. React to the given bug indicated
by the number below on http://bugs.openttd.org.
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
will not be solved" section.
2) Known bugs in 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.
The bugs in this section all refer to a ticket in our bug tracking system
that you can find at: http://bugs.openttd.org
@@ -39,11 +39,13 @@ 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
2.1) Known bugs that will not be solved
---- ----------------------------------
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
@@ -257,30 +259,3 @@ 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.

View File

@@ -1,28 +1,11 @@
openttd (1.1.0~beta5) unstable; urgency=low
openttd (1.1~svn-0) UNRELEASED; urgency=low
* New upstream release 1.1.0-beta5
* Unreleased SVN version. Versioned to allow normal upgrades to released
versions.
-- Matthijs Kooijman <matthijs@stdin.nl> Fri, 04 Feb 2011 22:00:00 +0100
-- Matthijs Kooijman <matthijs@stdin.nl> Fri, 24 Dec 2010 00:00:00 +0000
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
-- Matthijs Kooijman <matthijs@stdin.nl> Sun, 09 Jan 2011 18:00:00 +0100
openttd (1.1.0~beta2) unstable; urgency=low
* New upstream release 1.1.0-beta2
-- Matthijs Kooijman <matthijs@stdin.nl> Fri, 31 Dec 2010 18:00:00 +0100
openttd (1.1.0~beta1) unstable; urgency=low
openttd (1.1.0~beta1); urgency=low
* New upstream release 1.1.0-beta1

View File

@@ -1,6 +1,6 @@
@echo off
set OPENTTD_VERSION=1.1.0-beta5
set OPENTTD_VERSION=1.1.0-beta1
set OPENSFX_VERSION=0.8.0
set NOSOUND_VERSION=0.8.0
set OPENGFX_VERSION=0.7.0

View File

@@ -2,7 +2,7 @@
#-------------------------------------------------------------------------------
# spec file for the openttd rpm package
#
# Copyright (c) 2007-2011 The OpenTTD developers
# Copyright (c) 2007-2010 The OpenTTD developers
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself
@@ -26,7 +26,6 @@ Source: %{name}-%{version}-source.tar.bz2
Requires: fontconfig
Requires: SDL
Requires: zlib
Requires: xz-devel
BuildRequires: gcc-c++
BuildRequires: fontconfig-devel
BuildRequires: libpng-devel

View File

@@ -2,8 +2,8 @@
!define APPV_MAJOR 1
!define APPV_MINOR 1
!define APPV_MAINT 0
!define APPV_BUILD 4
!define APPV_EXTRA "-beta5"
!define APPV_BUILD 0
!define APPV_EXTRA "-beta1"
!define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "${APPV_MAJOR}.${APPV_MINOR}.${APPV_MAINT}${APPV_EXTRA}" ; Define application version

View File

@@ -157,10 +157,8 @@ Function DetermineSVNVersion()
If version <> "norev000" Then
If InStr(url, "branches") Then
branch = Mid(url, InStr(url, "branches/") + 9)
End If
If InStr(url, "tags") Then
version = Mid(url, InStr(url, "tags/") + 5)
url = Mid(url, InStr(url, "branches/") + 9)
branch = Mid(url, 1, InStr(2, url, "/") - 1)
End If
Else ' version <> "norev000"
' svn detection failed, reset error and try git
@@ -201,7 +199,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,26 +208,13 @@ 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
@@ -237,7 +222,7 @@ Function DetermineSVNVersion()
If version = "norev000" Then
' git detection failed, reset error and try mercurial (hg)
Err.Clear
Set oExec = WshShell.Exec("hg id -i")
Set oExec = WshShell.Exec("hg parents")
If Err.Number = 0 Then
' Wait till the application is finished ...
Do While oExec.Status = 0
@@ -245,21 +230,8 @@ Function DetermineSVNVersion()
If oExec.ExitCode = 0 Then
line = OExec.StdOut.ReadLine()
hash = Left(line, 12)
hash = Mid(line, InStrRev(line, ":") + 1)
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
@@ -278,23 +250,11 @@ 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|firstline}\n" & Chr(34) & " --cwd ../")
Set oExec = WshShell.Exec("hg log -f -k " & Chr(34) & "(svn r" & Chr(34) & " -l 1 --template " & Chr(34) & "{desc}\n" & Chr(34) & " --cwd ../")
If Err.Number = 0 Then
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"
revision = Mid(OExec.StdOut.ReadLine(), 7)
revision = Mid(revision, 1, InStr(revision, ")") - 1)
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

View File

@@ -1,35 +1,34 @@
OpenTTD readme
Last updated: 2011-02-04
Release version: 1.1.0-beta5
OpenTTD README
Last updated: 2010-12-24
Release version: 1.1.0-beta1
------------------------------------------------------------------------
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 (portable media)
* 4.1 (Required) 3rd party files
* 4.2 OpenTTD directories
* 4.3 Portable Installations (External Media)
5.0) OpenTTD features
* 5.1) Logging of potentially dangerous actions
6.0) Configuration file
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.
@@ -37,8 +36,7 @@ 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
@@ -49,8 +47,9 @@ 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.
@@ -88,8 +87,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
@@ -141,9 +140,8 @@ 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:
@@ -159,8 +157,9 @@ 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
@@ -187,8 +186,9 @@ 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,7 +248,8 @@ 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:
@@ -288,8 +289,10 @@ 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 (portable media)
---- ---------------------------------------
4.3) Portable Installations (External 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/).
@@ -302,8 +305,9 @@ 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
@@ -322,8 +326,10 @@ 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
@@ -352,8 +358,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.
@@ -362,8 +368,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
@@ -415,8 +421,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
@@ -440,7 +446,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.
@@ -464,9 +470,8 @@ 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
@@ -480,8 +485,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.
@@ -498,8 +503,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
@@ -518,9 +523,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.
@@ -553,9 +558,8 @@ 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

View File

@@ -126,8 +126,6 @@ public:
/** Wrapper function for AIScanner::GetAIConsoleList */
static char *GetConsoleList(char *p, const char *last);
/** Wrapper function for AIScanner::GetAIConsoleLibraryList */
static char *GetConsoleLibraryList(char *p, const char *last);
/** Wrapper function for AIScanner::GetAIInfoList */
static const AIInfoList *GetInfoList();
/** Wrapper function for AIScanner::GetUniqueAIInfoList */

View File

@@ -10,6 +10,7 @@
/** @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"
@@ -107,10 +108,10 @@ int AIConfig::GetSetting(const char *name) const
{
SettingValueList::const_iterator it = this->settings.find(name);
/* Return the default value if the setting is not set, or if we are in a not-custom difficult level */
if (it == this->settings.end() || GetGameSettings().difficulty.diff_level != 3) {
if (it == this->settings.end() || ((_game_mode == GM_MENU) ? _settings_newgame.difficulty.diff_level : _settings_game.difficulty.diff_level) != 3) {
if (this->info == NULL) {
assert(strcmp("start_date", name) == 0);
switch (GetGameSettings().difficulty.diff_level) {
switch ((_game_mode == GM_MENU) ? _settings_newgame.difficulty.diff_level : _settings_game.difficulty.diff_level) {
case 0: return AI::START_NEXT_EASY;
case 1: return AI::START_NEXT_MEDIUM;
case 2: return AI::START_NEXT_HARD;

View File

@@ -294,11 +294,6 @@ void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
return AI::ai_scanner->GetAIConsoleList(p, last);
}
/* static */ char *AI::GetConsoleLibraryList(char *p, const char *last)
{
return AI::ai_scanner->GetAIConsoleLibraryList(p, last);
}
/* static */ const AIInfoList *AI::GetInfoList()
{
return AI::ai_scanner->GetAIInfoList();

View File

@@ -10,6 +10,7 @@
/** @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"
@@ -184,11 +185,6 @@ struct AIListWindow : public Window {
virtual void OnInvalidateData(int data)
{
if (_game_mode == GM_NORMAL && Company::IsValidID(this->slot)) {
delete this;
return;
}
this->vscroll->SetCount((int)this->ai_info_list->size() + 1);
/* selected goes from -1 .. length of ai list - 1. */
@@ -267,7 +263,7 @@ struct AISettingsWindow : public Window {
this->vscroll = this->GetScrollbar(AIS_WIDGET_SCROLLBAR);
this->FinishInitNested(desc, slot); // Initializes 'this->line_height' as side effect.
this->SetWidgetDisabledState(AIS_WIDGET_RESET, _game_mode != GM_MENU && Company::IsValidID(this->slot));
this->SetWidgetDisabledState(AIS_WIDGET_RESET, _game_mode != GM_MENU);
this->vscroll->SetCount((int)this->ai_config->GetConfigList()->size());
}
@@ -301,7 +297,7 @@ struct AISettingsWindow : public Window {
int y = r.top;
for (; this->vscroll->IsVisible(i) && it != config->GetConfigList()->end(); i++, it++) {
int current_value = config->GetSetting((*it).name);
bool editable = _game_mode == GM_MENU || !Company::IsValidID(this->slot) || (it->flags & AICONFIG_INGAME) != 0;
bool editable = (_game_mode == GM_MENU) || ((it->flags & AICONFIG_INGAME) != 0);
StringID str;
TextColour colour;
@@ -357,7 +353,7 @@ struct AISettingsWindow : public Window {
AIConfigItemList::const_iterator it = this->ai_config->GetConfigList()->begin();
for (int i = 0; i < num; i++) it++;
AIConfigItem config_item = *it;
if (_game_mode == GM_NORMAL && Company::IsValidID(this->slot) && (config_item.flags & AICONFIG_INGAME) == 0) return;
if (_game_mode != GM_MENU && (config_item.flags & AICONFIG_INGAME) == 0) return;
bool bool_item = (config_item.flags & AICONFIG_BOOLEAN) != 0;
@@ -402,10 +398,8 @@ struct AISettingsWindow : public Window {
break;
case AIS_WIDGET_RESET:
if (_game_mode == GM_MENU || !Company::IsValidID(this->slot)) {
this->ai_config->ResetSettings();
this->SetDirty();
}
this->ai_config->ResetSettings();
this->SetDirty();
break;
}
}
@@ -415,7 +409,6 @@ struct AISettingsWindow : public Window {
if (StrEmpty(str)) return;
AIConfigItemList::const_iterator it = this->ai_config->GetConfigList()->begin();
for (int i = 0; i < this->clicked_row; i++) it++;
if (_game_mode == GM_NORMAL && Company::IsValidID(this->slot) && (it->flags & AICONFIG_INGAME) == 0) return;
int32 value = atoi(str);
this->ai_config->SetSetting((*it).name, value);
this->CheckDifficultyLevel();
@@ -436,11 +429,6 @@ struct AISettingsWindow : public Window {
this->SetDirty();
}
}
virtual void OnInvalidateData(int data)
{
if (_game_mode == GM_NORMAL && Company::IsValidID(this->slot)) delete this;
}
};
/** Widgets for the AI settings window. */
@@ -568,7 +556,7 @@ struct AIConfigWindow : public Window {
{
switch (widget) {
case AIC_WIDGET_NUMBER:
SetDParam(0, GetGameSettings().difficulty.max_no_competitors);
SetDParam(0, _settings_newgame.difficulty.max_no_competitors);
break;
}
}
@@ -583,25 +571,6 @@ struct AIConfigWindow : public Window {
}
}
/**
* Can the AI config in the given company slot be edited?
* @param slot The slot to query.
* @return True if and only if the given AI Config slot can e edited.
*/
static bool IsEditable(CompanyID slot)
{
if (_game_mode != GM_NORMAL) {
return slot > 0 && slot <= GetGameSettings().difficulty.max_no_competitors;
}
if (Company::IsValidID(slot) || slot < 0) return false;
int max_slot = GetGameSettings().difficulty.max_no_competitors;
for (CompanyID cid = COMPANY_FIRST; cid < (CompanyID)max_slot && cid < MAX_COMPANIES; cid++) {
if (Company::IsValidHumanID(cid)) max_slot++;
}
return slot < max_slot;
}
virtual void DrawWidget(const Rect &r, int widget) const
{
switch (widget) {
@@ -610,16 +579,16 @@ struct AIConfigWindow : public Window {
for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < MAX_COMPANIES; i++) {
StringID text;
if ((_game_mode != GM_NORMAL && i == 0) || (_game_mode == GM_NORMAL && Company::IsValidHumanID(i))) {
text = STR_AI_CONFIG_HUMAN_PLAYER;
} else if (AIConfig::GetConfig((CompanyID)i)->GetInfo() != NULL) {
if (AIConfig::GetConfig((CompanyID)i)->GetInfo() != NULL) {
SetDParamStr(0, AIConfig::GetConfig((CompanyID)i)->GetInfo()->GetName());
text = STR_JUST_RAW_STRING;
} else if (i == 0) {
text = STR_AI_CONFIG_HUMAN_PLAYER;
} else {
text = STR_AI_CONFIG_RANDOM_AI;
}
DrawString(r.left + 10, r.right - 10, y + WD_MATRIX_TOP, text,
(this->selected_slot == i) ? TC_WHITE : (IsEditable((CompanyID)i) ? TC_ORANGE : TC_SILVER));
(this->selected_slot == i) ? TC_WHITE : ((i > _settings_newgame.difficulty.max_no_competitors || i == 0) ? TC_SILVER : TC_ORANGE));
y += this->line_height;
}
break;
@@ -634,9 +603,9 @@ struct AIConfigWindow : public Window {
case AIC_WIDGET_INCREASE: {
int new_value;
if (widget == AIC_WIDGET_DECREASE) {
new_value = max(0, GetGameSettings().difficulty.max_no_competitors - 1);
new_value = max(0, _settings_newgame.difficulty.max_no_competitors - 1);
} else {
new_value = min(MAX_COMPANIES - 1, GetGameSettings().difficulty.max_no_competitors + 1);
new_value = min(MAX_COMPANIES - 1, _settings_newgame.difficulty.max_no_competitors + 1);
}
IConsoleSetSetting("difficulty.max_no_competitors", new_value);
this->InvalidateData();
@@ -651,8 +620,8 @@ struct AIConfigWindow : public Window {
}
case AIC_WIDGET_MOVE_UP:
if (IsEditable(this->selected_slot) && IsEditable((CompanyID)(this->selected_slot - 1))) {
Swap(GetGameSettings().ai_config[this->selected_slot], GetGameSettings().ai_config[this->selected_slot - 1]);
if (this->selected_slot > 1) {
Swap(_settings_newgame.ai_config[this->selected_slot], _settings_newgame.ai_config[this->selected_slot - 1]);
this->selected_slot--;
this->vscroll->ScrollTowards(this->selected_slot);
this->InvalidateData();
@@ -660,8 +629,8 @@ struct AIConfigWindow : public Window {
break;
case AIC_WIDGET_MOVE_DOWN:
if (IsEditable(this->selected_slot) && IsEditable((CompanyID)(this->selected_slot + 1))) {
Swap(GetGameSettings().ai_config[this->selected_slot], GetGameSettings().ai_config[this->selected_slot + 1]);
if (this->selected_slot < _settings_newgame.difficulty.max_no_competitors) {
Swap(_settings_newgame.ai_config[this->selected_slot], _settings_newgame.ai_config[this->selected_slot + 1]);
this->selected_slot++;
this->vscroll->ScrollTowards(this->selected_slot);
this->InvalidateData();
@@ -694,16 +663,16 @@ struct AIConfigWindow : public Window {
virtual void OnInvalidateData(int data)
{
if (!IsEditable(this->selected_slot)) {
if (this->selected_slot == 0 || this->selected_slot > _settings_newgame.difficulty.max_no_competitors) {
this->selected_slot = INVALID_COMPANY;
}
this->SetWidgetDisabledState(AIC_WIDGET_DECREASE, GetGameSettings().difficulty.max_no_competitors == 0);
this->SetWidgetDisabledState(AIC_WIDGET_INCREASE, GetGameSettings().difficulty.max_no_competitors == MAX_COMPANIES - 1);
this->SetWidgetDisabledState(AIC_WIDGET_DECREASE, _settings_newgame.difficulty.max_no_competitors == 0);
this->SetWidgetDisabledState(AIC_WIDGET_INCREASE, _settings_newgame.difficulty.max_no_competitors == MAX_COMPANIES - 1);
this->SetWidgetDisabledState(AIC_WIDGET_CHANGE, this->selected_slot == INVALID_COMPANY);
this->SetWidgetDisabledState(AIC_WIDGET_CONFIGURE, this->selected_slot == INVALID_COMPANY);
this->SetWidgetDisabledState(AIC_WIDGET_MOVE_UP, this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot - 1)));
this->SetWidgetDisabledState(AIC_WIDGET_MOVE_DOWN, this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot + 1)));
this->SetWidgetDisabledState(AIC_WIDGET_MOVE_UP, this->selected_slot == INVALID_COMPANY || this->selected_slot == 1);
this->SetWidgetDisabledState(AIC_WIDGET_MOVE_DOWN, this->selected_slot == INVALID_COMPANY || this->selected_slot == _settings_newgame.difficulty.max_no_competitors);
}
};

View File

@@ -15,6 +15,7 @@
#include "ai_info.hpp"
#include "ai_scanner.hpp"
#include "../settings_type.h"
#include "../openttd.h"
#include "../debug.h"
#include "../rev.h"
@@ -337,7 +338,7 @@ int AIInfo::GetSettingDefaultValue(const char *name) const
for (AIConfigItemList::const_iterator it = this->config_list.begin(); it != this->config_list.end(); it++) {
if (strcmp((*it).name, name) != 0) continue;
/* The default value depends on the difficulty level */
switch (GetGameSettings().difficulty.diff_level) {
switch ((_game_mode == GM_MENU) ? _settings_newgame.difficulty.diff_level : _settings_game.difficulty.diff_level) {
case 0: return (*it).easy_value;
case 1: return (*it).medium_value;
case 2: return (*it).hard_value;

View File

@@ -74,7 +74,6 @@
#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. */
@@ -210,7 +209,6 @@ void AIInstance::RegisterAPI()
SQAIEventSubsidyExpired_Register(this->engine);
SQAIEventSubsidyOffer_Register(this->engine);
SQAIEventSubsidyOfferExpired_Register(this->engine);
SQAIEventTownFounded_Register(this->engine);
SQAIEventVehicleCrashed_Register(this->engine);
SQAIEventVehicleLost_Register(this->engine);
SQAIEventVehicleUnprofitable_Register(this->engine);

View File

@@ -343,19 +343,6 @@ char *AIScanner::GetAIConsoleList(char *p, const char *last) const
return p;
}
char *AIScanner::GetAIConsoleLibraryList(char *p, const char *last) const
{
p += seprintf(p, last, "List of AI Libraries:\n");
AILibraryList::const_iterator it = this->library_list.begin();
for (; it != this->library_list.end(); it++) {
AILibrary *i = (*it).second;
p += seprintf(p, last, "%10s (v%d): %s\n", i->GetName(), i->GetVersion(), i->GetDescription());
}
p += seprintf(p, last, "\n");
return p;
}
#if defined(ENABLE_NETWORK)
#include "../network/network_content.h"
#include "../3rdparty/md5/md5.h"

View File

@@ -12,8 +12,11 @@
#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.
@@ -55,11 +58,6 @@ public:
*/
char *GetAIConsoleList(char *p, const char *last) const;
/**
* Get the list of available AI Libraries for the console.
*/
char *GetAIConsoleLibraryList(char *p, const char *last) const;
/**
* Get the list of all registered AIs.
*/

View File

@@ -12,7 +12,12 @@
#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"

View File

@@ -9,7 +9,6 @@
/** @file ai_accounting.cpp Implementation of AIAccounting. */
#include "../../stdafx.h"
#include "ai_accounting.hpp"
Money AIAccounting::GetCosts()

View File

@@ -9,7 +9,6 @@
/** @file ai_airport.cpp Implementation of AIAirport. */
#include "../../stdafx.h"
#include "ai_airport.hpp"
#include "ai_station.hpp"
#include "../../station_base.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_base.cpp Implementation of AIBase. */
#include "../../stdafx.h"
#include "ai_base.hpp"
#include "../../network/network.h"
#include "../../core/random_func.hpp"

View File

@@ -9,7 +9,6 @@
/** @file ai_basestation.cpp Implementation of AIBaseStation. */
#include "../../stdafx.h"
#include "ai_basestation.hpp"
#include "../../station_base.h"
#include "../../string_func.h"

View File

@@ -12,6 +12,7 @@
#ifndef AI_BASESTATION_HPP
#define AI_BASESTATION_HPP
#include "ai_object.hpp"
#include "ai_error.hpp"
/**

View File

@@ -9,7 +9,6 @@
/** @file ai_bridge.cpp Implementation of AIBridge. */
#include "../../stdafx.h"
#include "ai_bridge.hpp"
#include "ai_rail.hpp"
#include "../ai_instance.hpp"
@@ -152,7 +151,9 @@ static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
{
if (!IsValidBridge(bridge_id)) return -1;
return min(::GetBridgeSpec(bridge_id)->max_length, _settings_game.construction.max_bridge_length) + 2;
uint max = ::GetBridgeSpec(bridge_id)->max_length;
if (max >= MAX_BRIDGE_LENGTH && _settings_game.construction.longbridges) max = MAX_BRIDGE_LENGTH_LONGBRIDGES;
return max + 2;
}
/* static */ int32 AIBridge::GetMinLength(BridgeID bridge_id)

View File

@@ -12,7 +12,9 @@
#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.

View File

@@ -9,7 +9,6 @@
/** @file ai_bridgelist.cpp Implementation of AIBridgeList and friends. */
#include "../../stdafx.h"
#include "ai_bridgelist.hpp"
#include "ai_bridge.hpp"
#include "../../bridge.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_cargo.cpp Implementation of AICargo. */
#include "../../stdafx.h"
#include "ai_cargo.hpp"
#include "../../cargotype.h"
#include "../../economy_func.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_cargolist.cpp Implementation of AICargoList and friends. */
#include "../../stdafx.h"
#include "ai_cargolist.hpp"
#include "ai_industry.hpp"
#include "../../cargotype.h"

View File

@@ -21,19 +21,15 @@
*
* API additions:
* \li IsEnd for all lists.
* \li AIEventTownFounded
* \li AIIndustry::GetIndustryID
* \li AIIndustryType::INDUSTRYTYPE_TOWN
* \li AIIndustryType::INDUSTRYTYPE_UNKNOWN
* \li AIOrder::IsVoidOrder
* \li AIRail::GetName
* \li AITown::IsCity
*
* API removals:
* \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.

View File

@@ -9,7 +9,6 @@
/** @file ai_company.cpp Implementation of AICompany. */
#include "../../stdafx.h"
#include "ai_company.hpp"
#include "ai_error.hpp"
#include "../../command_func.h"

View File

@@ -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"

View File

@@ -9,7 +9,6 @@
/** @file ai_date.cpp Implementation of AIDate. */
#include "../../stdafx.h"
#include "ai_date.hpp"
#include "../../date_func.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_depotlist.cpp Implementation of AIDepotList and friends. */
#include "../../stdafx.h"
#include "ai_depotlist.hpp"
#include "../../company_func.h"
#include "../../depot_base.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_engine.cpp Implementation of AIEngine. */
#include "../../stdafx.h"
#include "ai_engine.hpp"
#include "ai_cargo.hpp"
#include "../../company_func.h"

View File

@@ -12,7 +12,9 @@
#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"

View File

@@ -9,7 +9,6 @@
/** @file ai_enginelist.cpp Implementation of AIEngineList and friends. */
#include "../../stdafx.h"
#include "ai_enginelist.hpp"
#include "../../company_func.h"
#include "../../engine_base.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_error.cpp Implementation of AIError. */
#include "../../stdafx.h"
#include "ai_error.hpp"
#include "../../core/bitmath_func.hpp"

View File

@@ -9,7 +9,6 @@
/** @file ai_event.cpp Implementation of AIEvent. */
#include "../../stdafx.h"
#include "ai_event_types.hpp"
#include <queue>

View File

@@ -50,7 +50,6 @@ public:
AI_ET_STATION_FIRST_VEHICLE,
AI_ET_DISASTER_ZEPPELINER_CRASHED,
AI_ET_DISASTER_ZEPPELINER_CLEARED,
AI_ET_TOWN_FOUNDED,
};
/**

View File

@@ -52,7 +52,6 @@ void SQAIEvent_Register(Squirrel *engine)
SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_STATION_FIRST_VEHICLE, "AI_ET_STATION_FIRST_VEHICLE");
SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_DISASTER_ZEPPELINER_CRASHED, "AI_ET_DISASTER_ZEPPELINER_CRASHED");
SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_DISASTER_ZEPPELINER_CLEARED, "AI_ET_DISASTER_ZEPPELINER_CLEARED");
SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_TOWN_FOUNDED, "AI_ET_TOWN_FOUNDED");
SQAIEvent.DefSQMethod(engine, &AIEvent::GetEventType, "GetEventType", 1, "x");

View File

@@ -9,7 +9,6 @@
/** @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"

View File

@@ -12,6 +12,7 @@
#ifndef AI_EVENT_TYPES_HPP
#define AI_EVENT_TYPES_HPP
#include "ai_object.hpp"
#include "ai_event.hpp"
#include "ai_company.hpp"
@@ -799,37 +800,4 @@ private:
StationID station;
};
/**
* Event Town Founded, indicating a new town has been created.
*/
class AIEventTownFounded : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventTownFounded"; }
/**
* @param town The town that was created.
*/
AIEventTownFounded(TownID town) :
AIEvent(AI_ET_TOWN_FOUNDED),
town(town)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventTownFounded *Convert(AIEvent *instance) { return (AIEventTownFounded *)instance; }
/**
* Get the TownID of the town.
* @return The TownID of the town that was created.
*/
TownID GetTownID() { return this->town; }
private:
TownID town;
};
#endif /* AI_EVENT_TYPES_HPP */

View File

@@ -454,24 +454,3 @@ void SQAIEventDisasterZeppelinerCleared_Register(Squirrel *engine)
SQAIEventDisasterZeppelinerCleared.PostRegister(engine);
}
namespace SQConvert {
/* Allow AIEventTownFounded to be used as Squirrel parameter */
template <> AIEventTownFounded *GetParam(ForceType<AIEventTownFounded *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIEventTownFounded *)instance; }
template <> AIEventTownFounded &GetParam(ForceType<AIEventTownFounded &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEventTownFounded *)instance; }
template <> const AIEventTownFounded *GetParam(ForceType<const AIEventTownFounded *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIEventTownFounded *)instance; }
template <> const AIEventTownFounded &GetParam(ForceType<const AIEventTownFounded &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEventTownFounded *)instance; }
template <> int Return<AIEventTownFounded *>(HSQUIRRELVM vm, AIEventTownFounded *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventTownFounded", res, NULL, DefSQDestructorCallback<AIEventTownFounded>); return 1; }
} // namespace SQConvert
void SQAIEventTownFounded_Register(Squirrel *engine)
{
DefSQClass <AIEventTownFounded> SQAIEventTownFounded("AIEventTownFounded");
SQAIEventTownFounded.PreRegister(engine, "AIEvent");
SQAIEventTownFounded.DefSQStaticMethod(engine, &AIEventTownFounded::Convert, "Convert", 2, ".x");
SQAIEventTownFounded.DefSQMethod(engine, &AIEventTownFounded::GetTownID, "GetTownID", 1, "x");
SQAIEventTownFounded.PostRegister(engine);
}

View File

@@ -9,7 +9,6 @@
/** @file ai_execmode.cpp Implementation of AIExecMode. */
#include "../../stdafx.h"
#include "ai_execmode.hpp"
#include "../../company_base.h"
#include "../../company_func.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_gamesettings.cpp Implementation of AIGameSettings. */
#include "../../stdafx.h"
#include "ai_gamesettings.hpp"
#include "../../settings_internal.h"

View File

@@ -12,6 +12,7 @@
#ifndef AI_GAMESETTINGS_HPP
#define AI_GAMESETTINGS_HPP
#include "ai_object.hpp"
#include "ai_vehicle.hpp"
/**

View File

@@ -9,7 +9,6 @@
/** @file ai_group.cpp Implementation of AIGroup. */
#include "../../stdafx.h"
#include "ai_group.hpp"
#include "ai_engine.hpp"
#include "../ai_instance.hpp"

View File

@@ -12,6 +12,7 @@
#ifndef AI_GROUP_HPP
#define AI_GROUP_HPP
#include "ai_object.hpp"
#include "ai_vehicle.hpp"
/**

View File

@@ -9,7 +9,6 @@
/** @file ai_grouplist.cpp Implementation of AIGroupList and friends. */
#include "../../stdafx.h"
#include "ai_grouplist.hpp"
#include "../../company_func.h"
#include "../../group.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_industry.cpp Implementation of AIIndustry. */
#include "../../stdafx.h"
#include "ai_industry.hpp"
#include "ai_cargo.hpp"
#include "ai_map.hpp"

View File

@@ -9,7 +9,6 @@
/** @file ai_industrylist.cpp Implementation of AIIndustryList and friends. */
#include "../../stdafx.h"
#include "ai_industrylist.hpp"
#include "../../industry.h"

View File

@@ -9,10 +9,8 @@
/** @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"

View File

@@ -12,6 +12,8 @@
#ifndef AI_INDUSTRYTYPE_HPP
#define AI_INDUSTRYTYPE_HPP
#include "ai_object.hpp"
#include "ai_error.hpp"
#include "ai_list.hpp"
/**

View File

@@ -9,7 +9,6 @@
/** @file ai_industrytypelist.cpp Implementation of AIIndustryTypeList. */
#include "../../stdafx.h"
#include "ai_industrytypelist.hpp"
#include "../../industry.h"

View File

@@ -12,6 +12,7 @@
#ifndef AI_INDUSTRYTYPELIST_HPP
#define AI_INDUSTRYTYPELIST_HPP
#include "ai_list.hpp"
#include "ai_industrytype.hpp"
/**

View File

@@ -9,7 +9,6 @@
/** @file ai_list.cpp Implementation of AIList. */
#include "../../stdafx.h"
#include "ai_list.hpp"
#include "../../debug.h"
#include "../../script/squirrel.hpp"

View File

@@ -9,7 +9,6 @@
/** @file ai_log.cpp Implementation of AILog. */
#include "../../stdafx.h"
#include "ai_log.hpp"
#include "../../core/alloc_func.hpp"
#include "../../company_func.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_map.cpp Implementation of AIMap. */
#include "../../stdafx.h"
#include "ai_map.hpp"
#include "../../tile_map.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_marine.cpp Implementation of AIMarine. */
#include "../../stdafx.h"
#include "ai_marine.hpp"
#include "ai_station.hpp"
#include "../../station_base.h"

View File

@@ -12,6 +12,7 @@
#ifndef AI_MARINE_HPP
#define AI_MARINE_HPP
#include "ai_object.hpp"
#include "ai_error.hpp"
/**

View File

@@ -11,11 +11,7 @@
#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"

View File

@@ -12,6 +12,7 @@
#ifndef AI_OBJECT_HPP
#define AI_OBJECT_HPP
#include "../../stdafx.h"
#include "../../misc/countedptr.hpp"
#include "../../road_type.h"
#include "../../rail_type.h"

View File

@@ -9,8 +9,6 @@
/** @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"
@@ -48,7 +46,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)->GetNumManualOrders() || order_position == ORDER_CURRENT);
return AIVehicle::IsValidVehicle(vehicle_id) && order_position >= 0 && (order_position < ::Vehicle::Get(vehicle_id)->GetNumOrders() || order_position == ORDER_CURRENT);
}
/**
@@ -65,14 +63,7 @@ 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;
}
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;
return v->GetOrder(order_position);
}
/* static */ bool AIOrder::IsGotoStationOrder(VehicleID vehicle_id, OrderPosition order_position)
@@ -131,18 +122,8 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
{
if (!AIVehicle::IsValidVehicle(vehicle_id)) return 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;
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;
}
@@ -279,7 +260,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 = ::ResolveOrder(vehicle_id, order_position);
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
return (OrderPosition)order->GetConditionSkipToOrder();
}
@@ -288,7 +269,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 = ::ResolveOrder(vehicle_id, order_position);
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
return (OrderCondition)order->GetConditionVariable();
}
@@ -297,7 +278,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 = ::ResolveOrder(vehicle_id, order_position);
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
return (CompareFunction)order->GetConditionComparator();
}
@@ -306,7 +287,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 = ::ResolveOrder(vehicle_id, order_position);
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
int32 value = order->GetConditionValue();
if (order->GetConditionVariable() == OCV_MAX_SPEED) value = value * 16 / 10;
return value;
@@ -318,7 +299,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 = ::ResolveOrder(vehicle_id, order_position);
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
return (AIOrder::StopLocation)order->GetStopLocation();
}
@@ -505,7 +486,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 = ::ResolveOrder(vehicle_id, order_position);
const Order *order = Vehicle::Get(vehicle_id)->GetOrder(order_position);
AIOrderFlags current = GetOrderFlags(vehicle_id, order_position);

View File

@@ -12,6 +12,7 @@
#ifndef AI_ORDER_HPP
#define AI_ORDER_HPP
#include "ai_object.hpp"
#include "ai_error.hpp"
/**
@@ -112,13 +113,7 @@ public:
CF_INVALID = -1, ///< Invalid compare function, do not use.
};
/**
* 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.
*/
/** Different constants related to the OrderPosition */
enum OrderPosition {
ORDER_CURRENT = 0xFF, ///< Constant that gets resolved to the current order.
ORDER_INVALID = -1, ///< An invalid order.

View File

@@ -9,7 +9,6 @@
/** @file ai_rail.cpp Implementation of AIRail. */
#include "../../stdafx.h"
#include "ai_rail.hpp"
#include "ai_map.hpp"
#include "ai_station.hpp"
@@ -20,18 +19,6 @@
#include "../../newgrf.h"
#include "../../newgrf_generic.h"
#include "../../newgrf_station.h"
#include "../../strings_func.h"
/* static */ char *AIRail::GetName(RailType rail_type)
{
if (!IsRailTypeAvailable(rail_type)) return NULL;
static const int len = 64;
char *railtype_name = MallocT<char>(len);
::GetString(railtype_name, GetRailTypeInfo((::RailType)rail_type)->strings.menu_text, &railtype_name[len - 1]);
return railtype_name;
}
/* static */ bool AIRail::IsRailTile(TileIndex tile)
{

View File

@@ -12,6 +12,8 @@
#ifndef AI_RAIL_HPP
#define AI_RAIL_HPP
#include "ai_object.hpp"
#include "ai_error.hpp"
#include "ai_tile.hpp"
/**
@@ -35,6 +37,9 @@ 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]
};
@@ -91,18 +96,6 @@ public:
BT_WAYPOINT, ///< Build a rail waypoint
};
/**
* Get the name of a rail type.
* @param rail_type The rail type to get the name of.
* @pre IsRailTypeAvailable(rail_type).
* @return The name the rail type has.
* @note Since there is no string with only the name of the track, the text which
* is shown in the dropdown where you can chose a track type is returned. This
* means that the name could be something like "Maglev construction" instead
* of just "Maglev".
*/
static char *GetName(RailType rail_type);
/**
* Checks whether the given tile is actually a tile with rail that can be
* used to traverse a tile. This excludes rail depots but includes

View File

@@ -38,45 +38,47 @@ 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_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_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");
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::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::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");
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");
SQAIRail.DefSQStaticMethod(engine, &AIRail::GetName, "GetName", 2, ".i");
SQAIRail.DefSQStaticMethod(engine, &AIRail::IsRailTile, "IsRailTile", 2, ".i");
SQAIRail.DefSQStaticMethod(engine, &AIRail::IsLevelCrossingTile, "IsLevelCrossingTile", 2, ".i");
SQAIRail.DefSQStaticMethod(engine, &AIRail::IsRailDepotTile, "IsRailDepotTile", 2, ".i");

View File

@@ -9,7 +9,6 @@
/** @file ai_railtypelist.cpp Implementation of AIRailTypeList and friends. */
#include "../../stdafx.h"
#include "ai_railtypelist.hpp"
#include "../../rail.h"
#include "../../company_func.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_road.cpp Implementation of AIRoad. */
#include "../../stdafx.h"
#include "ai_map.hpp"
#include "ai_station.hpp"
#include "ai_cargo.hpp"

View File

@@ -12,6 +12,8 @@
#ifndef AI_ROAD_HPP
#define AI_ROAD_HPP
#include "ai_object.hpp"
#include "ai_error.hpp"
#include "ai_tile.hpp"
/**

View File

@@ -9,7 +9,6 @@
/** @file ai_sign.cpp Implementation of AISign. */
#include "../../stdafx.h"
#include "ai_sign.hpp"
#include "table/strings.h"
#include "../ai_instance.hpp"

View File

@@ -12,7 +12,9 @@
#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.

View File

@@ -9,7 +9,6 @@
/** @file ai_signlist.cpp Implementation of AISignList and friends. */
#include "../../stdafx.h"
#include "ai_signlist.hpp"
#include "ai_sign.hpp"
#include "../../signs_base.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_station.cpp Implementation of AIStation. */
#include "../../stdafx.h"
#include "ai_station.hpp"
#include "ai_cargo.hpp"
#include "ai_map.hpp"

View File

@@ -12,6 +12,8 @@
#ifndef AI_STATION_HPP
#define AI_STATION_HPP
#include "ai_object.hpp"
#include "ai_error.hpp"
#include "ai_road.hpp"
#include "ai_basestation.hpp"

View File

@@ -9,7 +9,6 @@
/** @file ai_stationlist.cpp Implementation of AIStationList and friends. */
#include "../../stdafx.h"
#include "ai_stationlist.hpp"
#include "ai_vehicle.hpp"
#include "../../company_func.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_subsidy.cpp Implementation of AISubsidy. */
#include "../../stdafx.h"
#include "ai_subsidy.hpp"
#include "ai_date.hpp"
#include "../../subsidy_base.h"

View File

@@ -12,6 +12,7 @@
#ifndef AI_SUBSIDY_HPP
#define AI_SUBSIDY_HPP
#include "ai_object.hpp"
#include "ai_company.hpp"
/**

View File

@@ -9,7 +9,6 @@
/** @file ai_subsidylist.cpp Implementation of AISubsidyList. */
#include "../../stdafx.h"
#include "ai_subsidylist.hpp"
#include "../../subsidy_base.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_testmode.cpp Implementation of AITestMode. */
#include "../../stdafx.h"
#include "ai_testmode.hpp"
#include "../../company_base.h"
#include "../../company_func.h"

View File

@@ -9,7 +9,6 @@
/** @file ai_tile.cpp Implementation of AITile. */
#include "../../stdafx.h"
#include "ai_tile.hpp"
#include "ai_map.hpp"
#include "ai_town.hpp"

View File

@@ -12,6 +12,7 @@
#ifndef AI_TILE_HPP
#define AI_TILE_HPP
#include "ai_list.hpp"
#include "ai_error.hpp"
#include "ai_company.hpp"

View File

@@ -9,7 +9,6 @@
/** @file ai_tilelist.cpp Implementation of AITileList and friends. */
#include "../../stdafx.h"
#include "ai_tilelist.hpp"
#include "ai_industry.hpp"
#include "../../industry.h"

View File

@@ -12,8 +12,8 @@
#ifndef AI_TILELIST_HPP
#define AI_TILELIST_HPP
#include "ai_station.hpp"
#include "ai_list.hpp"
#include "ai_station.hpp"
/**
* Creates an empty list, in which you can add tiles.

View File

@@ -9,7 +9,6 @@
/** @file ai_town.cpp Implementation of AITown. */
#include "../../stdafx.h"
#include "ai_town.hpp"
#include "ai_map.hpp"
#include "ai_cargo.hpp"
@@ -130,13 +129,6 @@
return ::HasBit(::Town::Get(town_id)->statues, _current_company);
}
/* static */ bool AITown::IsCity(TownID town_id)
{
if (!IsValidTown(town_id)) return false;
return ::Town::Get(town_id)->larger_town;
}
/* static */ int AITown::GetRoadReworkDuration(TownID town_id)
{
if (!IsValidTown(town_id)) return -1;

View File

@@ -12,6 +12,7 @@
#ifndef AI_TOWN_HPP
#define AI_TOWN_HPP
#include "ai_object.hpp"
#include "ai_company.hpp"
/**
@@ -225,14 +226,6 @@ public:
*/
static bool HasStatue(TownID town_id);
/**
* Find out if the town is a city.
* @param town_id The town to check.
* @pre IsValidTown(town_id).
* @return True if the town is a city.
*/
static bool IsCity(TownID town_id);
/**
* Find out how long the town is undergoing road reconstructions.
* @param town_id The town to check.

View File

@@ -71,7 +71,6 @@ void SQAITown_Register(Squirrel *engine)
SQAITown.DefSQStaticMethod(engine, &AITown::GetDistanceSquareToTile, "GetDistanceSquareToTile", 3, ".ii");
SQAITown.DefSQStaticMethod(engine, &AITown::IsWithinTownInfluence, "IsWithinTownInfluence", 3, ".ii");
SQAITown.DefSQStaticMethod(engine, &AITown::HasStatue, "HasStatue", 2, ".i");
SQAITown.DefSQStaticMethod(engine, &AITown::IsCity, "IsCity", 2, ".i");
SQAITown.DefSQStaticMethod(engine, &AITown::GetRoadReworkDuration, "GetRoadReworkDuration", 2, ".i");
SQAITown.DefSQStaticMethod(engine, &AITown::GetExclusiveRightsCompany, "GetExclusiveRightsCompany", 2, ".i");
SQAITown.DefSQStaticMethod(engine, &AITown::GetExclusiveRightsDuration, "GetExclusiveRightsDuration", 2, ".i");

Some files were not shown because too many files have changed in this diff Show More