Commit Graph

242 Commits (63f1a935307a6138a4e0d5d4b26f4423e48ac075)

Author SHA1 Message Date
hackykid daae0d315a (svn r2428) - Feature: [newgrf] Implement shorter train vehicles (Therax), and the callback that goes with it.
- Codechange: Remove some magic numbers (PALETTE_CRASH)
19 years ago
tron 24fd817420 (svn r2409) Missed one _map_owner -> IsTileOwner() 19 years ago
tron ff0030936e (svn r2408) Introduce SetTileOwner() and use it 19 years ago
tron a9b95b3cbb (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner 19 years ago
Darkvater ba8c649fac (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 19 years ago
Darkvater 33bb043fb6 (svn r2322) - CodeChange: doxygen commented the tunnel-crash fix. Also if (bla) {return;} else {return;} is not proper code. It's if (bla) {return;} return; ;) 19 years ago
matthijs 1436fa9d48 (svn r2320) - Fix: [ 1185176 ] Train in tunnel is not properly detected by signal code (Hackykid) 19 years ago
Darkvater 037ef4cd31 (svn r2317) - Fix: [ 1193048 ] Pre-signal stays red when there is only a single exit signal (dinno) 19 years ago
Darkvater ddd4958164 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
- CodeChange: remove cmd-misuses CmdStartScenario() and CmdDestroyCompanyHQ()
- Fix (invisible): when parameter checking CmdRestoreOrderIndex() the vehicle did not have its orders yet, so it would fail. So move doing this until AFTER the orders have been added back in RestoreVehicleOrders()
19 years ago
Darkvater 84b0d2d19d (svn r2286) - CodeChange: paramcheck the next batch of commands.
- Fix (regression): fix up terraform land where every player can terraform land (towns, map generation), and player can terraform different corners; used for building tunnels
19 years ago
Darkvater da1a7587af (svn r2285) - Codechange: Fix up some of the missing things from server-checking; namely bridge-type, bridge-length, dragged end-tile (bridge/station), station_spread
- Fix: [ 1197256 ] max station spread patch < 7 does not work. Station spread was not taking into account when not using drag&drop. Fix this up, and add a callback to the settings window to immediately reflect the changes.
19 years ago
Darkvater 419af5cece (svn r2279) - Fix: Check the parameters of the first 10 Commands. While there also add proper comments for the functions and fix up CmdFailed() 19 years ago
tron 738ea43ce1 (svn r2223) When adding tracks to a railway tile reset the ground to bare land, fix for a glitch in r2131 19 years ago
tron 1f5a66404f (svn r2195) Add CmdFailed() as the One True Way(tm) to check if a command failed. 20 years ago
celestar 23b1617cdf (svn r2173) -Fix: [ 1179380 ] Rail now builds on reserved land. Cause by the problem that CMD_ERROR is just the highest bit of the return value, but CMD_CLEAR_LANDSCAPE returns a negative value for owned land. So the highest bit is set as well. Note to self: Finish Command Patch 20 years ago
tron 03569d1c49 (svn r2134) Return the correct error message if rail is already under a bridge, fix for r2131 20 years ago
tron ffe868a38a (svn r2132) Fix copy&paste bug in r2131 20 years ago
tron e82468f627 (svn r2131) -Fix: Rewrite CmdBuildSingleRail(), this addresses several issues:
- Check input parameters for validity
- Adhere patch settings - you were able to build foundations under bridges even if foundations where deactivated
- Charge for foundations in all cases - foundations under bridges were for free
- Make the control flow more clear
20 years ago
truelight 7f6753ed89 (svn r2113) -Fix: first check if a vehicle is a train, before accessing u.rail 20 years ago
tron b2dd47f565 (svn r2102) Fix bug introduced in r2038, which gave you money for clearing occupied railway tiles ([1171926]) 20 years ago
tron 407b80656e (svn r2095) In CheckTrackCombination(): if () cascade -> switch, improve readability 20 years ago
tron b0006b2009 (svn r2094) In GetTileDesc_Track(): uint -> TileIndex, use enums, if () cascade -> switch 20 years ago
truelight 6f5dae6684 (svn r2059) -Codechange: rewrote SetSignalsAfterProc so now the tiles from the PF
are checked against the vehicle-position-hash, instead all vehicles to 
the PF-position-hash. Big speed increase (function usages drops from 9% 
to 0.5%!) for maps with a lot of trains.
20 years ago
truelight d1e158d6f7 (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
tron 0a95a224ff (svn r2040) Readd check that got accidently removed in r2022 20 years ago
tron ca83a54490 (svn r2039) IS_RAIL_DEPOT -> IsRailDepot, IS_RAIL_WAYPOINT -> IsRailWaypoint
remove now unused enums and remove a redundant condition in one if
20 years ago
tron 2695b93fee (svn r2038) -Fix: A player only received the money for one rail when clearing a tile with 2 rails and signals
While here rewrite parts of the function to (hopefully) increase clarity
20 years ago
tron b5c9012315 (svn r2022) Revise CmdRemoveSingleSignal: Check parameters for validity and simplify the function 20 years ago
tron ca3ccff729 (svn r1981) Typedef some structs and enums 20 years ago
tron 690dd5555c (svn r1903) Replace some casts and macro magic with proper typing, similar to r1902 20 years ago
tron 830565514c (svn r1867) Include tables/sprites.h only in files which need it 20 years ago
matthijs cc0966405b (svn r1834) - Fix: NPF does not check the owner of its target, busses try to enter other players' depots. TODO
- Add: asserts to find the v->u.rail.track == 0 problem.
- Add: IsValidDepot(), IsValidTown(), IsValidSign(), IsValidVehicle(), IsValidStation()
- Add: GetTileOwner(), IsTileOwner()
- Codechange: Replaced IsShipDepotTile(), IsTrainDepotTile(), IsRoadDepotTile() by IsTileDepotType().
- Codechange: typedeffed the MAP_OWNERS as Owner. Should be used as variable type.
- Codechange: Replaced a few uint by TileIndex.
20 years ago
tron 6984d6cd31 (svn r1832) Next byte -> char iteration: custom names 20 years ago
truelight bd7f37d592 (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
matthijs eb78cdb2d4 (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 bb680056b1 (svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names 20 years ago
darkvater 121f563daf (svn r1733) - Fix: oops "| 1" is SETBIT(x, 0), not 1 :(. Now you can remove signals again 20 years ago
darkvater d3e3965f0b (svn r1731) - Fix: [ 1106930 ] BugFix: placing signals with 2x1 drags workaround is completely rewritten. Also features checks for hacked/modified clients. Thanks a lot Hackykid! 20 years ago
tron 39858e696b (svn r1713) Split off several functions which query/set information about a single tile from map.h and put them into a seperate file tile.h 20 years ago
darkvater 7ba0a0d95c (svn r1624) -Fix: [1106930] BugFix: placing signals with 2x1 drags is treated as placing a single signal thus providing an easy fix for a nasty problem. 20 years ago
tron 81ee2d931b (svn r1610) Remove trailing whitespace (last time ever, i hope) 20 years ago
tron 97f893ae2f (svn r1596) Add some more statics 20 years ago
tron 94d5aeabb2 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 20 years ago
tron eee7d2e50d (svn r1585) Rewrite CmdBuildSignals()
This addresses several issues:
- Correct comments
- Check input parameters for validity (and don't assert() them)
- Reorder checks if action is possible to produce more meaningful error messages
- Correct bug where money was charged for an action which should be free
- Kill warning about uninitialized variable, because the variable exists no more
- Make more clear how the function works (at least i hope so)
20 years ago
darkvater 640985ce04 (svn r1567) -Fix: [110452] On horizontal/vertical tracks you are also charged for building/removing signals on the parallel track on the same tile. Signal updating is also correct. (Hackykid) 20 years ago
tron 90cafa9b15 (svn r1560) Introduce SetTileType() and SetTileHeight()
Replace direct references to _map_type_and_height with these
20 years ago
tron ca8eb44828 (svn r1542) Rename TileHeight to TilePixelHeight, because this is what it actually returns 20 years ago
tron 61a6bc544d (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts 20 years ago
truelight 7cafdf3b0b (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 589215c822 (svn r1508) Remove duplicate declarations and include proper headers where necessary 20 years ago
tron 414ac3286b (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 b450603437 (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
darkvater fc52b512aa (svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky. 20 years ago
miham 7bf7cf80ee (svn r1297) Language fixes in the source.. (ln-) 20 years ago
truelight 2f9e0b8e0c (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
tron a148ff4e0d (svn r1117) Move map arrays and some related macros into their own files map.c and map.h 20 years ago
tron b8e83ca03f (svn r955) Replace uint16 for orders with struct Order
This adds no functionality, but is a stepping stone for future improvement (like 16bit order indices) and is easier to read.
This changes preserves binary compatibility wrt savegames.
20 years ago
truelight d6a1f3e412 (svn r942) -Merged branch/network back into the trunk 20 years ago
tron 291d25a88b (svn r925) Use sound enums
Also play the correct sound when a toyland road vehicle breaks down
20 years ago
tron acbd1801c7 (svn r815) Include strings.h only in the files which need it.
This should reduce the compile time after altering english.txt by about 1/3, because "only" 62 instead of 90 .c files must be recompiled.
20 years ago
tron e8537f5512 (svn r787) Invert the sense of the DO_TRANS_BUILDINGS flag to be consistent with its own name and all other DO_* flags.
Now it is active-true.
20 years ago
tron 57adc97733 (svn r724) Remove restriction that a tile can only accept 3 cargo types.
This especially enables houses to accept passengers, mail, goods AND food.
Add string templates for up to 5 cargo types for the tile info window. If more are needed just add them.
Simplify (de-uglify) the logic for cargo acceptence for houses and split the goods/food table into two. The acceptance is unmodified, but accepting goods AND food is now trivially possible. The exact amounts have to be decided.
This is based on Celestar's changes in the map branch plus some further bits that will be merged there soon.
20 years ago
celestar 155f20329b (svn r657) Do not touch 0x8000 bit in sprite index for custom waypoints. (pasky) 20 years ago
miham 86d19cb577 (svn r647) Cleanup custom station classes handling. (pasky) 20 years ago
dominik d99b89ab29 (svn r614) [newgrf] Some minor code fixes 20 years ago
dominik fb64b4e499 (svn r612) [newgrf] Fix: custom waypoints on monorail/maglev are displayed correctly 20 years ago
darkvater ec434b208e (svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky). 20 years ago
dominik c2193ce1a8 (svn r609) Fixed choose waypoints dialogs, it works without assertion failures and with custom waypoint #0 selectable now. (pasky) 20 years ago
dominik 0bcc9b7573 (svn r608) [newgrf] enabled possibility to build default waypoint when custom waypoints are enabled 20 years ago
tron 249a170ace (svn r607) -Patch: [ 985102 ] static cleanup
Thanks to lvoge
20 years ago
darkvater 183c33931d (svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky). 20 years ago
darkvater e656a91736 (svn r602) -newgrf: Move DrawTileSeqStruct & co and struct SpriteGroup to sprite.h (pasky) 20 years ago
darkvater 5fcd71cf28 (svn r600) -newgrf: Relocation offset for custom station sprites is now stored separately, making it possible to show different sprites in waypoint selection dialog (pasky). 20 years ago
darkvater ccc496ba2c (svn r591) -newgrf: Store whole struct StationSpec in SetCustomStation(), not just the rendering data. This will be needed for variational stationspecs (pasky). 20 years ago
darkvater 397cc50f61 (svn r587) -newgrf: Rename all /Checkpoint/i tokens to 'Waypoint's. The name actually makes some sense and is also compatible with TTDPatch (pasky). 20 years ago
darkvater 989289fadd (svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky. 20 years ago
celestar eb50427670 (svn r581) -newgrf: Basic support for new stations - only waypoints supported now and only
the first custom one can be placed (no selector GUI, coming soon). This
also moves some global variables to {struct GRFFile} and reorders which
actions are processed in what stage, to get it all working together --
(pasky)
20 years ago
tron d641175e3c (svn r513) Merge revisions 402, 416, 417, 478, 479, 511, 512 from map to trunk
This includes 2 fixes
-Fix: [1048596] Monorail and Maglev sounds are swapped (r511)
-Add special case to load the jackhammer sound (r478)
The rest are cleanups und enumeration to make merging possible/easier
20 years ago
dominik 894bb262ad (svn r289) Fix: Checkpoints on snow have correct ground now 20 years ago
dominik ebc18e3957 (svn r288) Fix: new checkpoint graphics now also work for monorail/maglev 20 years ago
darkvater e295e46e3e (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
-CodeLayout: Remove trailing spaces and Windows linebreaks
20 years ago
darkvater fe8c317d3c (svn r205) -Fix: [1026271] Vehicle depots not transparent with transparent buildings. 20 years ago
truelight 7aa0bdf48b (svn r202) -Codechange: I missed some files with trailing spaces.. this should be
all ;)
20 years ago
truelight 10d54ac604 (svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
-Fix: some minor fixes around GetTileTrackStatus (blathijs)
20 years ago
darkvater 7b02cd3248 (svn r150) -Fix: [1010833] Turning on the magic bulldozer removes oil rigs
-Fix: [993493] Buildings on water
-Feature: Water floods everything, including vehicles.
20 years ago
truelight 788ace088d (svn r85) -Add: initial commit of new AI (enable in Patch menu)
-Add: generalised A* Algorithm
-Add: generalised queues (Fifo, Stack, InsSort, BinaryHeap)
20 years ago
darkvater 27f6fcae4c (svn r60) -Fix: signal_density is given as a parameter to autosignal. This means all players can define it for themselves.
-Fix a few warnings
20 years ago
darkvater 3fe3a023e5 (svn r59) -Feature: Added Autosignals, just like Autorail. Can copy signal style, convert signal<->semaphore, etc. Big thanks to betatesters Dribbel and Testman57 (Darkvater) 20 years ago
dominik ca120eedad (svn r40) Final slope graphics fix 20 years ago
darkvater f422014960 (svn r23) -Some omments on the code (blathijs) 20 years ago
dominik 65e35eeea8 (svn r14) Fix: railroad crossings on slopes are now possible 20 years ago
truelight efaeb275f7 (svn r1) Import of revision 975 of old (crashed) SVN 20 years ago