summaryrefslogtreecommitdiff
path: root/train_cmd.c
AgeCommit message (Collapse)Author
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
2005-01-27(svn r1701) Style police ^^tron
2005-01-27(svn r1700) - Fix: Hacked clients can no longer be used to build vehicles ↵bjarni
that are not available yet (Hackykid)
2005-01-27(svn r1696) Use GetTileSlope() instead of FindLandscapeHeightByTile() where ↵tron
it is sufficient. FindLandscapeHeightByTile() uses GetTileSlope() internally and adds some more info, which is discarded in these cases. While touching the code make a bit more clear how GetBridgeHeight() works.
2005-01-26(svn r1681) -Feature: New realistic acceleration.celestar
This will make things more difficult as narrow curves and depots impose rather strict speed limits. Feedback welcome For those who don't like low-speed curves: Switch it off
2005-01-25(svn r1676) Increase the size of TileIndex and TileIndexDiff to 32bits and ↵tron
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!
2005-01-24(svn r1652) Fix: train and road vehicle lists are now redrawn when vehicles ↵bjarni
enters/leaves a depot (Hackykid) fix: the ship status bar was not updated properly after a breakdown if show_speed was off (Hackykid)
2005-01-24(svn r1638) -Fix: Train crashes should no longer desync the game. This is ↵celestar
more of a workaround, as somewhere there might be some InteractiveRandom() abuse in the code.
2005-01-24(svn r1633) -Fix: [1040119] Flood and wagons in depotdarkvater
2005-01-23(svn r1629) added a counter to tell how many engines you have of each type ↵bjarni
to the autoreplace vehicle windows and made them show only the vehicles you actually have in the left list. this also fixes some window updates issues when autoreplacing
2005-01-23(svn r1610) Remove trailing whitespace (last time ever, i hope)tron
2005-01-23(svn r1604) Fix: [ 1105112 ] Destroyed train locks crossingsdominik
2005-01-22(svn r1596) Add some more staticstron
2005-01-22(svn r1594) Convert all undefined parameter lists to (void) and add the ↵tron
appropriate warning flags in the Makefile
2005-01-22(svn r1588) -Fix: [ 1105959 ] coded a workaround in the acceleration code so ↵celestar
that trains don't think they're on a slope while they drive around in a tunnel
2005-01-19(svn r1568) made an enum of train subtypes to make the code more readablebjarni
2005-01-19(svn r1565) -Fix: [ 1104969 ] Aircraft in hangar messages are now ↵celestar
revalidated before display -CodeChange: replaced one if (foo) return true else return false by return (foo)
2005-01-18(svn r1561) Fix: autoreplacing a singleheaded engine into a dualheaded ↵bjarni
engine now adds the the rear engine autoreplacing a dualheaded engine into a singleheaded engine now sells the rear engine as a sideeffect of this, the price for replacing both engines are now added and displayed once from the depot(instead of two identical numbers written on top of each other, looking like one) fix: cost for autorenew dualheaded engines were doubled and their value where doubled too
2005-01-18(svn r1558) -Fix: [ 1104350 ] Crashed trains do not initiate the lost vehicleCelestar
message anymore
2005-01-17(svn r1554) -Fix: [ 1103187 ] Order Check messages are now validated beforecelestar
displayed, so that there are no stray error messages any more. -Feature/Fix: Order Checking is only execute for ONE vehicle in an order-share system
2005-01-17(svn r1550) Remove useless function declarationtron
2005-01-17(svn r1549) Clean up some functions:tron
uint tile -> TileIndex tile if () cascade -> switch ()
2005-01-16(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn ↵tron
them into inline functions and add some asserts
2005-01-15(svn r1525) -Codechange: rewrote the _order_array, now it can be made dynamic.truelight
-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!
2005-01-09(svn r1445) -Fix: reversing a train also reverses the UP and DOWN status for ↵truelight
the realistic acceleration calculation -Fix: there was a big bug in setting the UP and DOWN flags making it easy possible for a overloaded train to go up a mountain. This is no longer possible. They will hang at a certain height
2005-01-07(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn ↵tron
the latter into inline functions names Tile[XY]
2005-01-06(svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns ↵truelight
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 *.
2005-01-06(svn r1402) Trim trailing whitespacetron
2005-01-05(svn r1386) Move TileIndexDiff to map.htron
Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir()
2005-01-04(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for ↵darkvater
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.
2005-01-04(svn r1367) -Fix: Full-Loading trains no longer get "lost" after a while ↵matthijs
(Hackykid)
2005-01-02(svn r1323) Adding autoreplace featurebjarni
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()
2004-12-28(svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and ↵truelight
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!!
2004-12-27(svn r1283) -Add: AutoRenew is now a client-side patch instead of a ↵truelight
game-side patch Note: this is the first commit that breaks compatibility with 0.3.5! -Fix: Bufferoverflow with autorenew_money. It is now a 32-bit integer.
2004-12-21(svn r1211) -Feature: Introduce sticky windows to all vehicle windows...Just ↵darkvater
make sure you do not sticky more than 23 at a time. Also a lot of places in the code invalidated the 'status bar' of the vehicle, referring to it as widget 4. This is now widget 5 and has been #definitized
2004-12-21(svn r1200) -Fix: Fixed bug pointed out by Tron: when a train is on the truelight
road/rail-crossing, and you let an other train drive towards it, reverse it, the lights no longer go off.
2004-12-21(svn r1199) -Fix: [ 958098 ] No longer road/rail crossing signals hang when ↵truelight
a train is reversed at the wrong moment (Yeah, our longest open bug finally fixed :) :) :))