Commit Graph

71 Commits (6cdb9580e2cca96f4ad96504ed22a9e93cb06dd6)

Author SHA1 Message Date
matthijs 6eb094c726 (svn r2256) - Fix: Trains cannot find a depot when they are in a tunnel. (glx)
- Add: GetVehicleTrackdir() helper function.
- Codechange: Moved SortStruct from vehicle_gui.h to ttd.h, so the dependency from vehicle.h on vehicle_gui.h could be removed.
- Codechange: Typedeffed the VehicleTypes struct so it can be used as the type for Vehicle.type instead of "byte".
- Codechange: Removed prototype for VehicleSorter(), which had no implementation anymore and was never called.
19 years ago
truelight 4573a9f872 (svn r2099) -Fix: no longer chat-messages hang when the game wraps around 2090
-Codechange: while trying to find this bug, made texteff.c a bit more readable :)
20 years ago
truelight 83637d164e (svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.h
-Codechange: rewrote some functions while moving waypoint-stuff
-Add: added support for 64k waypoints
-Fix: made the waypoint struct a bit more logic (no bit-fucking)
20 years ago
truelight fbb11ea366 (svn r2042) -Fix: forgot to remove a printf ;) 20 years ago
truelight 88ef277dc3 (svn r2041) -Fix: not all vehicles did get a day_proc call (because of rounding errors) 20 years ago
pasky 087d78d465 (svn r2033) - Fix: Fix some more desync by saving the town growth frequency iterator _cur_town_iter. Needed to bump a svg revision for that thanks to the braindead SlGlob thing, or at least I don't know how to do it without bumping it. 20 years ago
celestar f41be0b25a (svn r2030) -Fix: Save _cur_town_ctr with all its bits to prevent desyncs 20 years ago
pasky ad579912f4 (svn r2021) Fix: Enlarge _cur_town_ctr from byte to uint32 so that all the towns are considered when growing them even for big maps, where much more than 256 towns are around; reported by Tomasz Dubiński <uboottd@hydra.polsl.gliwice.pl>. The savegame still saves just the lowest 8 bits but that doesn't hurt so much. 20 years ago
pasky 6902a8b294 (svn r1950) Fix: A slight adjustment in the DoRandom() function which however causes dramatic improvement in the distribution of random numbers.
With the original generator, e.g. Random()%44 on 100 attempts regularily
generated only 22 different values! With this adjustment, the distribution is
much more uniform, almost approaching the glibc's random() call.

This means the random numbers are actually usable i.e.  for the town names
generators which almost never tried a large part of the names while others were
very frequent.

Note that we attempted to test whether the randomness did not degrade in some
other way, and it came clean from the tests we performed. If you spot anything
fishy, try without this patch, though.
20 years ago
tron 7a690eb5fb (svn r1879) Revise name handling, no functional changes 20 years ago
tron 27dc506a03 (svn r1832) Next byte -> char iteration: custom names 20 years ago
truelight e9c93f9c0c (svn r1817) -Codechange: Moved depot-functions to depot.c
-Codechange: Added wrappers around depot-access (GetDepot no exists)
-Codechange: Made depot-functions a bit more logic (no longer 
GetDepotByTile crashes your game when you request it on a non-depot tile)
-Add: made depots dynamic (yes, 64k depots are possible now)
20 years ago
tron 0381073e56 (svn r1813) Declare functions implemented in strings.c in their own shiny new header (though i think some of these function don't belong into strings.c) 20 years ago
tron 7aae12d55d (svn r1808) Use strcmp() instead of home brewed function str_eq() 20 years ago
truelight 42f98c7eec (svn r1783) -Add: Dynamic vehicles (now up to 64k of vehicles) 20 years ago
matthijs a2dec6c32a (svn r1751) - Feature: New PathFinder (NPF).
- Supports trains, road vehicles and ships.
	- Uses A* pathfinding (same codebase as the new ai).
	- Currently unlimited search depth, so might perform badly on large maps/networks (especially ships).
	- Will always find a route if there is one.
	- Allows custom penalties for obstacles to be set in openttd.cfg (npf_ values).
	- With NPF enabled, ships can have orders that are very far apart. Be careful, this will break (ships get lost) when the old pathfinder is used again.
- Feature: Disabling 90 degree turns for trains and ships.
	- Requires NPF to be enabled.
	- Ships and trains can no longer make weird 90 degree turns on tile borders.
- Codechange: Removed table/directions.h.
	- table/directions.h contained ugly static tables but was included more than once. The tables, along with a few new ones are in npf.[ch] now. Better suggestions for a location?
- Fix: Binary heap in queue.c did not allocate enough space, resulting in a segfault.
- Codechange: Rewritten FindFirstBit2x64, added KillFirstBit2x64.
- Codechange: Introduced constant INVALID_TILE, to replace the usage of 0 as an invalid tile. Also replaces TILE_WRAPPED.
- Codechange: Moved TileAddWrap() to map.[ch] 
- Add TileIndexDiffCByDir(), TileIndexDiffCByDir(). 
- Codechange: Moved IsTrainStationTile() to station.h
- Add: IsRoadStationTile() and GetRoadStationDir().
20 years ago
tron 7bbcf5875c (svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names 20 years ago
tron b29877e14c (svn r1723) Save the map size in tiles, not number of bits 20 years ago
tron 3a89108a55 (svn r1722) -Feature: Bigger maps - anyone? 20 years ago
celestar 752b3f0dd6 (svn r1721) -Feature: It is now possible to build multiple road stations (up to 8) on
a single station.
Thanks to: Truelight for the saveload code, Darkvater and Hackykid for
network testing and Tron for proof-reading 1500 lines of diff.
20 years ago
bjarni 5665d51bb3 (svn r1680) Feature: Replace train GUI now remembers the railtype selected in the dropdown menu 20 years ago
tron 6d23dac1f6 (svn r1677) Forgot to change the save/load size for 3 variables 20 years ago
truelight 24a34936db (svn r1622) -Fix: variables can't be defined after a statement.. (Igor2Code) 20 years ago
truelight 8edff76765 (svn r1621) -Fix: fixed some compiler warnings for the random-debug-switch 20 years ago
tron e5cd6b6193 (svn r1596) Add some more statics 20 years ago
tron 189ca73707 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 20 years ago
truelight d275109e79 (svn r1525) -Codechange: rewrote the _order_array, now it can be made dynamic.
-Codechange: renamed all 'schedule' stuff to 'order(list)'
-Codechange: moved all order-stuff to order_cmd.c / order.h
-Codechange: vehicles that share orders are now linked to eachother
  with next_shared/prev_shared in Vehicle

  Developers: please use AssignOrder to assign data to an order. If not, 
   you _WILL_ make the save-routine to assert!
20 years ago
tron 4136f395bf (svn r1508) Remove duplicate declarations and include proper headers where necessary 20 years ago
darkvater 06cc62f40d (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
-Fix: fixed some compiler warnings
-Added PF_NETWORK_ONLY flag to settings. Such a setting can only be modified in a network game.
20 years ago
truelight a243285af4 (svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
dynamic arrays
20 years ago
darkvater 5fac6142e8 (svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu)
-Added endgame score on 1 jan 2051 where you are added to the highscore if sufficiently large points have been accumulated. Game is paused while
-These values are saved in hs.dat; added read/write functions for it
-Added code to delete all windows to show charts. There is one issue left: somehow a news-gui pops up in front of the the chart at the end of the game.
20 years ago
darkvater 29b4ab04c3 (svn r1465) -Fix: [1099101] starting year patch goes out of range. Clamped year between 1920-2090 as wel as adding defines for it. 20 years ago
tron 49584082a0 (svn r1451) Fix some of the signed/unsigned comparison warnings 20 years ago
tron 55e6b4f928 (svn r1447) Move TILE_ADD(), TILE_ADDXY() and SafeTileAdd() to map.[ch] and make the latter map size agnostic 20 years ago
darkvater 5edecb9495 (svn r1437) -Fix: Safetileadd preprocessor magic is the same as for GCC and no longer extern 20 years ago
tron 76c7f3b14e (svn r1416) Print sensible information in SafeTileAdd() if gcc is used 20 years ago
tron 7ca6b2b8b0 (svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY] 20 years ago
truelight 63e97754fb (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
(in prepare of dynamic arrays):
  - DEREF_XXX is changed into GetXXX
  - All direct call are directed via GetXXX
  - struct Industry has now an index-field
  - ENUM'd some stuff
  - Replaced home built loops with FOR_ALL_XXX
  - Added _stations_size, _vehicles_size, ... which gives the length of the
    array (which will be dynamic in the near future)
  - Changed lengtof(XXX) to _XXX_size (e.g. _stations_size)
  - Removed all endof(XXX) (because mostly it was part of a FOR_ALL_XXX)
  - Made the sort-functions of all 4 dynamic
  - Made all 4 Initialize functions more of the same
  - Some minor tab-fixing and stuff
  (tnx to Tron for proof-reading my 100kb patch ;))

  Note for all: please do NOT directly call _stations, _vehicles, _towns and
  _industries, but use the right wrapper to access them. Thank you.
  Ps: please also do not use 'v++', where v is of type Vehicle *.
20 years ago
tron 8b7c1e94e1 (svn r1402) Trim trailing whitespace 20 years ago
tron 67161506ad (svn r1386) Move TileIndexDiff to map.h
Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir()
20 years ago
darkvater 3a48ab4c54 (svn r1365) -Fix: very, very nasty buffer overflow bug introduced with replace vehicles. You CANNOT access the i[255] of an array that only has 255 elements! I will kick the next person that does that so hard...goddammit (I only noticed it because it screwed up my console in the debug build and took me at least an hour to fix) 20 years ago
darkvater 79d29b7633 (svn r1346) -Fix: fix signed/unsigned warnings
-Fix: latent removal of 2 lines from ttd.c which I forgot because the file was not saved :O
20 years ago
tron c0702318d2 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY] 20 years ago
tron 32bfe0dddd (svn r1337) Use MapMax[XY]() (or MapSize[XY]() if appropriate) instead of TILE_MAX_[XY]
While here replace one erroneous TILE_MAX_X with MapMaxY()
20 years ago
bjarni 29d8c5bb50 (svn r1323) Adding autoreplace feature
This feature works much like autorenew, but it will get you a new engine type instead of a new one of the same type. Once 
ordered, it will automatically replace the engines while they visits a depot. The GUI for setting this up have been added on the 
vehicle overview windows
Note: autorenew is now autoreplace, but to the same engine type
Nice new features, that was added to make this possible
- windows can now have two independant vertical scrollbars
- CMD_SHOW_NO_ERROR have been added as a flag for DoCommandP. It will make it do the action instead of showing the red box with 
estimated costs even if shift is pressed
- fixed problem where enginetypes where not initialized when loading a game. It's now done in InitializeGame()
20 years ago
miham 57852f6498 (svn r1297) Language fixes in the source.. (ln-) 20 years ago
truelight c2ee8d70e4 (svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
an uint8 till the savegame version is bumped to version 5. Then it works 
automaticly as a fully uint16. So _stations[] can not be increased till 
after the bump!!
20 years ago
truelight c9645885d0 (svn r1252) -Add: [Network] With 'set restart_game_date' you can set the date for in
which year the server must restart hisself. (0 = disabled, default value)
20 years ago
bjarni fb345e983e (svn r1236) MorphOS: added make release like in OSX (tokai)
MorphOS: cleaned up the code telling the difference between AmigaOS and MorphOS (tokai)
20 years ago
truelight 90b2b2144b (svn r1227) -Add: Ingame Server-list (select Internet, then Find Servers)
-Fix: UDPListener was launched wrongly
-Fix: Not all sockets have broadcast enabled anymore
-Fix: Server-advertise retries 3 times before giving up
20 years ago