Commit Graph

118 Commits (89587c1d5180617cec62342d585661481a364e68)

Author SHA1 Message Date
Darkvater 5e6923e936 (svn r2290) - CodeChange: protect the next batch of commands. This brings us to a total of 61, which is 53% :)
- CodeChange: To correctly accept engine-prototypes, the best-player checking has been moved to its own function, I hope it functions the same as before.
- CodeChange: Added symbolic types of PlayerID, OrderID and EngineID. For engines also added GetEngine() and IsEngineIndex(), similar to the other such functions.
- CodeChange: To correctly build industries, some tables have been moved to build_industry.h. The only way to find out currently if an industry is valid in a climate is by looping all industries and checking if it matches. Also to comply with the patch setting build_rawmaterial_industries, it is assumed that these industries do not accept any cargo of any type. This can and probably should changed in the future to some flag in their struct. Also use _opt_ptr instead of _opt.
- CodeChange: implemented the HQ checking code inspired by MarkR2 in "[ 1190944 ] Many commands not checked for security".  Unfortunately it is impossible to prevent only deleting a HQ by a modified client atm.
- CodeChange: For insert order and modify order their parameters are implicitely truncated to 8 bits, instead of the 16 bits said in the comments.
19 years ago
Darkvater ab954a934a (svn r2288) - CodeChange: protected the next batch of commands (41 so far, out of 115).
- CodeChange: changed the airport gui airport-type checking. Added function GetValidAirports() that returns bitmasked availibility, is also used for checking.
- CodeChange: to check tree-planting, 2 const arrays have been moved to table/tree_land.h (type and count)
- CodeChange: added IsTownIndex() in following of IsStationIndex(), etc.
- Fix (regression): road tunnels did not work anymore, forgot that their type was 0x200 (documented now)
19 years ago
Darkvater edd8c87502 (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 2b96754673 (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 3ad11e0ad4 (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 b90e9d49ca (svn r2278) When renaming a station, check if the station exists and belongs to the correct player 19 years ago
matthijs 2ab5eee78b (svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
Buoys will now try to get within 3 tiles of a buoy instead of a the actual buoy tile. This gets ships to got past buoys in a realistic (IMO) way instead of barging right through them.
- Fix: [NPF] Trains get curves penalties sometimes even when the track is straight.
- Add: [NPF] Ships get a penalty for going over buoys now, so they will try to go around.
- Add: [NPF] Ships get a penalty for curves too, yay for straight lines.
- Add: TrackdirToTrack(), TrackToTrackdir(), IsDiagonalTrack() and IsDiagonalTrackdir() helper functions.
- Add: IsBuoy() and IsBuoyTile() helper functions.
- Codechange: Rearranged part of the control flow of ShipController(), removing a goto.
19 years ago
Darkvater 878cebaa70 (svn r2210) - Fix: When a road-station is deleted, also delete the assigned slots of all vehicles headed to that station. This fixes an assertion, thanks go to Tron for finding the cause. 19 years ago
tron 02f5818912 (svn r2189) Introduce and use IsCompatibleTrainStationTile()
This should prevent trains, which are longer than the station, to turn around without stopping under certain circumstances and fix speed limit for trains entering a station, when realistic accerlation is used
19 years ago
tron 4dbf5b37cc (svn r2176) Revise CheckOprhanedSlot():
- Don't assert the vehicle type, as it can be anything
- Don't touch the slot information of the vehicle, because it's possible that it is not a road vehicle anymore and even if it is, it has nothing to to with that slot
- Trim the debug printout, because the information about the vehicle is arbitrary
(Joint effort with Darkvater)
20 years ago
Darkvater 7ef681eaed (svn r2168) - Fix: Various stages of invisible trains, and wrong v->u.rail.track combinations. When a vehicle was sold its (possibly) assigned road slot for multislot was not cleared, thus resulting in a bug confusion. This should fix [ 1178520 ] Assertion failure in ai.c (invalid v->u.rail.track). With big thanks to TrueLight for the demo-recording patch, BJH for the wonderful savegame, Hackykid for his brilliant suggestions of the problem and Celestar for... ehm, making it all possible ;p 20 years ago
celestar 51eeea477b (svn r2097) -Codechange: [Multistop] Prettified the previous commit 20 years ago
celestar f42d17c6b3 (svn r2096) -Codechange: [Multistop] Modfied some debug stuff 20 years ago
celestar 6e142d523e (svn r2055) -CodeChange: Begun introducting StationID 20 years ago
celestar f179dc7acc (svn r2031) -Fix: Station #256 now gets cargo delivered as well 20 years ago
darkvater cc99c3e262 (svn r2011) - Fix: [ 1162209 ] Fix OS/2 build (orudge) #2 20 years ago
tron 4bf173e9c1 (svn r1981) Typedef some structs and enums 20 years ago
tron e6e3e69da4 (svn r1976) Cleanups - mostly indentation and fiddling with loops 20 years ago
Darkvater 3e51317236 (svn r1961) - Fix: [ 1158618 ] Segmentation fault when loading savegame, out of bounds array check. 20 years ago
pasky bcc9dcd210 (svn r1958) GenerateStationName() tidyup. 20 years ago
tron 4325f13f74 (svn r1928) Miscellaneous cleanups (data types, whitespace, const correctness) 20 years ago
tron 3aa99a660e (svn r1927) Replace implementation of UpdateStationAcceptance(). The new one doesn't malloc() and calculates the station area in one pass instead of 3 20 years ago
tron 0c3927ce4a (svn r1921) -Fix: Out of bounds array access which caused oil rigs to accept other cargo types besides passengers and mail 20 years ago
celestar d449145799 (svn r1872) -Fix: Fixed an inline problem which caused MSVC6 to not compile :/ 20 years ago
tron 204d08140a (svn r1867) Include tables/sprites.h only in files which need it 20 years ago
tron f8d97a5f61 (svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters 20 years ago
tron 27dc506a03 (svn r1832) Next byte -> char iteration: custom names 20 years ago
truelight 020c1e9b6c (svn r1818) -Add: Dynamic orders (up to 64k orders) 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 f0f85a7ef3 (svn r1803) Move debugging stuff into files of it's own 20 years ago
celestar 422ebcf8e0 (svn r1799) -Codechange: [ Multistop ] Added debug class "ms" and more debugging
output for multistops
20 years ago
truelight 093ae2b4b4 (svn r1789) -Fix: there is no need to save the index, it is done for us 20 years ago
truelight 10adda0d73 (svn r1788) -Add: Made RoadStops dynamic. You can now create up to 64k roadstops. 20 years ago
truelight 1938a73c90 (svn r1776) -Add: Dynamic stations. You can now have up to 64k of stations 20 years ago
truelight ab3ed5c431 (svn r1770) -Fix: Hopefully last pieces of code that are containing a station-id
(and should be an uint16, not uint8)
20 years ago
tron 944bba1031 (svn r1769) Don't compute the same value twice, remove one function call 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
celestar b312055c80 (svn r1743) -Fix: Multistop: Added some debug output and made sure that orphaned slots are cleared. 20 years ago
celestar 6d1ee15b9a (svn r1735) -Fix: [ 1112285 ] Fixed an assertion error with stations where stops
were deleted, the assertions were just plain wrong at that place. Used a
more graceful handling. Todo: What happens if ALL stations in a schedule
have no suitable stop?
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
tron 97ae59fe1a (svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
This makes it necessary to rename TileType() to GetTileType() because a type and a function may not share the same name.
20 years ago
tron 5885b31bb4 (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
celestar 1bdd01867a (svn r1694) -Fix: Forgot to remove a DEBUG statement :( 20 years ago
Celestar 1fd8c45c55 (svn r1693) -Fix: [ 1108618 ] A wrong error message was displayed when trying to
expand railroad stations beyond maximum spread
20 years ago
tron 993a106679 (svn r1676) Increase the size of TileIndex and TileIndexDiff to 32bits and adapt the save/load data and some other parts of the code to that change
WARNING: If i made any mistake here it WILL lead to corrupted savegames!
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
dominik ef93fcfe48 (svn r1579) Fix: [ 1105963 ] Buoys can now only be removed if no ship has it in their schedule.
This makes buoys more useable in multiplayer games again, as buoys can't be deleted by other players if they are used.
20 years ago
bjarni 2fd3553d78 (svn r1568) made an enum of train subtypes to make the code more readable 20 years ago
tron 31d6f87d80 (svn r1560) Introduce SetTileType() and SetTileHeight()
Replace direct references to _map_type_and_height with these
20 years ago