summaryrefslogtreecommitdiff
path: root/train_cmd.c
AgeCommit message (Collapse)Author
2005-05-03(svn r2261) - Fix: When crashed vehicles try to find a depot for servicing, ↵matthijs
openttd asserts. Crashed vehicles shouldn't find depots anyway...
2005-05-02(svn r2256) - Fix: Trains cannot find a depot when they are in a tunnel. (glx)matthijs
- 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.
2005-04-15(svn r2202) - Fix: [NPF] When a vehicle could not reach its target, it would ↵matthijs
choose a random direction. It will now try to get as close as possible.
2005-04-12(svn r2189) Introduce and use IsCompatibleTrainStationTile()tron
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
2005-04-12(svn r2188) Revert r2185, because trains always accerlated (Requested by ↵tron
Celestar)
2005-04-12(svn r2187) Implement a slightly better workaround than r1588 did. (Joint ↵tron
effort with Celestar)
2005-04-11(svn r2185) -Fix: Made sure that the realistic acceleration does not freeze ↵celestar
trains anymore
2005-04-11(svn r2180) -Fix: Deceleration code now only takes into account rail station ↵celestar
tiles for computing the remaining distance
2005-04-11(svn r2179) - Fix: [ 1121437, 1114228 ] Vehicles not entering depots for ↵matthijs
auto servicing.
2005-04-02(svn r2119) - Fix: [ 1172878 ] Trains "Go to depot" button: click twice skip ↵pasky
to next order (patch by Loic GUILLOUX). I also added short explanation of OF_/OFB_ difference to order.h.
2005-03-29(svn r2105) -Codechange: Added a cache for the first vehicle of a chain to ↵celestar
increase performance, especially with many long trains
2005-03-25(svn r2058) -Fix: hopefully this fixes the reverse-train-in-depot-bugs (plural)truelight
2005-03-25(svn r2056) -Fix: [ 1166999 ] Strange cast removed. Thanks Troncelestar
2005-03-25(svn r2055) -CodeChange: Begun introducting StationIDcelestar
2005-03-24(svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.htruelight
-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)
2005-03-23(svn r2035) - Remove unneeded realloc()tron
- Use TileOffsByDir() instead of home brewed table
2005-03-20(svn r2034) -Codechange: Replaced the rather meaningless LOAD and UNLOAD ↵celestar
flags for depots by something more meaningful
2005-03-19(svn r2024) -Fix: [autoreplace] reverted all changes involving ↵bjarni
v->set_for_replacement as they caused desyncs. The bad sideeffect of this is that now no vehicle will automatically go to a depot anymore just because it is set to be autoreplaced. We will have to find a better way to solve this problem. Revisions reverted: 1640, 1707, 1709, 1710, 1712(but not the cheat prevention in this one)
2005-03-15(svn r2011) - Fix: [ 1162209 ] Fix OS/2 build (orudge) #2darkvater
2005-03-09(svn r1979) Const correctnesstron
2005-03-09(svn r1976) Cleanups - mostly indentation and fiddling with loopstron
2005-03-08(svn r1965) - Fix: [NPF] Forgot to update one line where NPFGetFlag() should ↵matthijs
have been used two commits ago. Message for last commit should have been: - Add: [NPF] Added penalty for curves, straighter paths are now preferred when the length is the same. (HackyKid)
2005-03-08(svn r1963) - Add: [NPF] Penalty for a red signal that is the last signal on ↵matthijs
the path. - Add: [NPF] NPFGetFlag() and NPFSetFlag() to wrap NPF node flag handling
2005-03-08(svn r1959) -Fix: Repaired two memleaks I have hacked :(Celestar
2005-03-06(svn r1947) As in r1946, permit DC_QUERY_COST even on non-depot tiles - so ↵pasky
that it works for the ai_new. It is de iure not a bug yet but let's be safe against future annoying headaches. Signed-Off-By: TrueLight
2005-03-06(svn r1942) Fix r1938tron
2005-03-06(svn r1938) Miscellaneous cleanups: const correctness, kill a goto, ...tron
2005-03-06(svn r1936) End some void-pointer-as-int-abuse; this also fixes a latent bug ↵tron
where a TileIndex was only 24bit wide (on 32bit architectures)
2005-03-06(svn r1935) Missing braces; while here turn the ifs into a single switchtron
2005-03-06(svn r1934) Small cleanup (uint -> TileIndex, (uint)-1 -> INVALID_TILE and ↵tron
similar stuff)
2005-03-03(svn r1922) - Fix: Disappearing of crashed trains inside tunnels were not ↵Darkvater
checked properly.
2005-02-22(svn r1898) Remove some unused macros from macros.h and move some others to ↵tron
more appropriate headers
2005-02-20(svn r1891) -Fix: [ 1143587 ] carriages of newgrfs can be refitted againcelestar
2005-02-12(svn r1863) Give the effect vehicle type enums more descriptive names and ↵tron
use the enum as parameter type for CreateEffectVehicle*() -Fix: [1116619] Generate the correct smoke type for diesel trains
2005-02-07(svn r1841) -Fix: [ 1117538 ] non-stop orders are no longer accidently skippedcelestar
2005-02-06(svn r1834) - Fix: NPF does not check the owner of its target, busses try to ↵matthijs
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.
2005-02-06(svn r1817) -Codechange: Moved depot-functions to depot.ctruelight
-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)
2005-02-04(svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up ↵truelight
to 5000 trains in one game (instead of the 240 which was the current value). Default max allowed vehicles per type is changed: Trains: 500 (old 80) Road: 500 (old 80) Ships: 200 (old 40) Aicraft: 300 (old 50) (Tnx to Celestar and Darkvater for checking the patch)
2005-02-02(svn r1770) -Fix: Hopefully last pieces of code that are containing a station-idtruelight
(and should be an uint16, not uint8)
2005-01-31(svn r1751) - Feature: New PathFinder (NPF).matthijs
- 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().
2005-01-31(svn r1749) Move the functions which calculate distances to map.[ch] and ↵tron
give the more meaningful names
2005-01-30(svn r1741) - Fix: added IsVehicleIndex() so it's possible to protect ↵bjarni
GetVehicle() from reading an invalid vehicle index - Fix: added check for v->type in some commands, which expects v to be a specific type Checks like this is needed to protect network servers from people, who hack their clients to either cheat or crash the server NOTE: if I made a mistake here it can make a function unreachable when it should be used. Here is one place to look if something weird happens
2005-01-30(svn r1740) -Fix: [ 1112342 ] Realistic acceleration works properly with ↵celestar
TTDPatch non-stop handling behaviour
2005-01-30(svn r1739) - Fix: type checking when selling vehicles (TrueLight)darkvater
2005-01-30(svn r1738) -Fix: [ 1108735 ] Fixed (hopefully) an assertion that was cause ↵celestar
by selling carriages in a MP game faster than the network can handle. (Truelight)
2005-01-30(svn r1727) - Fix: now CmdBuildRailVehicle() behaves correctly if DC_EXEC is setbjarni
this commit alters ai.c a little to get rid of the workaround from r1725 so AI players could still build locomotives
2005-01-29(svn r1725) - Fix: now trains can only be built in depots and you have to ↵bjarni
own the depot too (hacked client protection)
2005-01-29(svn r1718) Use the enum TileType as parameter/return type for ↵tron
[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.
2005-01-29(svn r1713) Split off several functions which query/set information about a ↵tron
single tile from map.h and put them into a seperate file tile.h
2005-01-29(svn r1712) - Fix: a hacked client can no longer send other players trains ↵bjarni
to a depot - Feature: [autoreplace] trains now tries to find a depot if they needs to be replaced Now all 4 types of vehicles goes to a depot if they needs to be replaced