Commit Graph

113 Commits (56ffd096daee0b345375496a2e7f3a36e747f532)

Author SHA1 Message Date
truelight 0560b88db2 (svn r2058) -Fix: hopefully this fixes the reverse-train-in-depot-bugs (plural) 20 years ago
celestar 6246150d8d (svn r2056) -Fix: [ 1166999 ] Strange cast removed. Thanks Tron 20 years ago
celestar 0cec257797 (svn r2055) -CodeChange: Begun introducting StationID 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 9655764730 (svn r2035) - Remove unneeded realloc()
- Use TileOffsByDir() instead of home brewed table
20 years ago
celestar a9c0a173bf (svn r2034) -Codechange: Replaced the rather meaningless LOAD and UNLOAD flags for depots by something more meaningful 20 years ago
bjarni e5abf58461 (svn r2024) -Fix: [autoreplace] reverted all changes involving 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)
20 years ago
darkvater d0ea6bcdf0 (svn r2011) - Fix: [ 1162209 ] Fix OS/2 build (orudge) #2 20 years ago
tron eea2dc6c78 (svn r1979) Const correctness 20 years ago
tron 9d1526e0a4 (svn r1976) Cleanups - mostly indentation and fiddling with loops 20 years ago
matthijs e9a1752683 (svn r1965) - Fix: [NPF] Forgot to update one line where NPFGetFlag() should 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)
20 years ago
matthijs 6a5495f83c (svn r1963) - Add: [NPF] Penalty for a red signal that is the last signal on the path.
- Add: [NPF] NPFGetFlag() and NPFSetFlag() to wrap NPF node flag handling
20 years ago
Celestar 79b2a245e6 (svn r1959) -Fix: Repaired two memleaks I have hacked :( 20 years ago
pasky 904700fc9f (svn r1947) As in r1946, permit DC_QUERY_COST even on non-depot tiles - so 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 20 years ago
tron 83cbb7b1da (svn r1942) Fix r1938 20 years ago
tron 12b223b3f9 (svn r1938) Miscellaneous cleanups: const correctness, kill a goto, ... 20 years ago
tron 505ecdc6b4 (svn r1936) End some void-pointer-as-int-abuse; this also fixes a latent bug where a TileIndex was only 24bit wide (on 32bit architectures) 20 years ago
tron 42520c1cc3 (svn r1935) Missing braces; while here turn the ifs into a single switch 20 years ago
tron 3892aece72 (svn r1934) Small cleanup (uint -> TileIndex, (uint)-1 -> INVALID_TILE and similar stuff) 20 years ago
Darkvater 5a24ba51c8 (svn r1922) - Fix: Disappearing of crashed trains inside tunnels were not checked properly. 20 years ago
tron a370af76d2 (svn r1898) Remove some unused macros from macros.h and move some others to more appropriate headers 20 years ago
celestar 6154175dc1 (svn r1891) -Fix: [ 1143587 ] carriages of newgrfs can be refitted again 20 years ago
tron 6d2b9d2c3a (svn r1863) Give the effect vehicle type enums more descriptive names and use the enum as parameter type for CreateEffectVehicle*()
-Fix: [1116619] Generate the correct smoke type for diesel trains
20 years ago
celestar 0e6109d360 (svn r1841) -Fix: [ 1117538 ] non-stop orders are no longer accidently skipped 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
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
truelight 99f3fe4c07 (svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up 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)
20 years ago
truelight 0668a6b485 (svn r1770) -Fix: Hopefully last pieces of code that are containing a station-id
(and should be an uint16, not uint8)
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
bjarni 7d967ad12a (svn r1741) - Fix: added IsVehicleIndex() so it's possible to protect 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
20 years ago
celestar fb3af3321a (svn r1740) -Fix: [ 1112342 ] Realistic acceleration works properly with TTDPatch non-stop handling behaviour 20 years ago
darkvater bc0198a4c3 (svn r1739) - Fix: type checking when selling vehicles (TrueLight) 20 years ago
celestar 39c55d0eb3 (svn r1738) -Fix: [ 1108735 ] Fixed (hopefully) an assertion that was cause by selling carriages in a MP game faster than the network can handle. (Truelight) 20 years ago
bjarni 3103119b6c (svn r1727) - Fix: now CmdBuildRailVehicle() behaves correctly if DC_EXEC is set
this commit alters ai.c a little to get rid of the workaround from r1725 so AI players could still build locomotives
20 years ago
bjarni 001cdf0ba2 (svn r1725) - Fix: now trains can only be built in depots and you have to own the depot too (hacked client protection) 20 years ago
tron 38587b60f7 (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 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
bjarni f853483424 (svn r1712) - Fix: a hacked client can no longer send other players trains 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
20 years ago
tron dba55a5742 (svn r1701) Style police ^^ 20 years ago
bjarni 72b9358291 (svn r1700) - Fix: Hacked clients can no longer be used to build vehicles that are not available yet (Hackykid) 20 years ago
tron 372b9cb827 (svn r1696) Use GetTileSlope() instead of FindLandscapeHeightByTile() where 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.
20 years ago
celestar ccd4f53a34 (svn r1681) -Feature: New realistic acceleration.
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
20 years ago
tron 07cb3068ae (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
bjarni f7774a007a (svn r1652) Fix: train and road vehicle lists are now redrawn when vehicles enters/leaves a depot (Hackykid)
fix: the ship status bar was not updated properly after a breakdown if show_speed was off (Hackykid)
20 years ago
celestar 3bd60674b8 (svn r1638) -Fix: Train crashes should no longer desync the game. This is more of a
workaround, as somewhere there might be some InteractiveRandom() abuse
in the code.
20 years ago
darkvater 59e099149c (svn r1633) -Fix: [1040119] Flood and wagons in depot 20 years ago
bjarni cf862380fc (svn r1629) added a counter to tell how many engines you have of each type 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
20 years ago
tron 81ee2d931b (svn r1610) Remove trailing whitespace (last time ever, i hope) 20 years ago
dominik 9b9cdb1bad (svn r1604) Fix: [ 1105112 ] Destroyed train locks crossings 20 years ago