Commit Graph

92 Commits (1312fe4468aa665dbe3f8b030c2836287bf42b4d)

Author SHA1 Message Date
bjarni 4a1d9a4775 (svn r2167) -fix: [autoreplace] trains now get the default cargo type if the engine
replaced from did not have cargo capacity (instead of refitting to passengers)
20 years ago
truelight 6a341663cc (svn r2156) -Fix: in revision 2104 someone forgot to add a very important check in
GetPrevVehicleInChain; this caused some nasty bugs in depots, like 
wagons without engines complain about not being stopped, and stuff like 
that. Hopefully this fixes those problems. With a big tnx to BJH for his 
perfect demo!
20 years ago
bjarni 19b87abd56 (svn r2139) -fix: "[ 1146215 ] Engine power not updated w/auto replace" autoreplace now forces an update of the cache. It should not affect gameplay as the
cache is updated each time the train starts moving, it's just an instant update of the detail window
20 years ago
truelight 4c9f0eefb4 (svn r2109) -Fix: use FindVehicleOnTileZ(tile, 0) over FindVehicleBetween(tile, tile, 0) 20 years ago
celestar 58a72bf483 (svn r2105) -Codechange: Added a cache for the first vehicle of a chain to increase performance, especially with many long trains 20 years ago
tron e39cb78b73 (svn r2104) Simplify implementation of Get{First,Prev}VehicleInChain() and remove a pointless check 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
truelight 625d041e99 (svn r2045) -Fix: hopefully fixed the desync problem. Please all test this revision!!
(with tnx to Celestar, Hackykid, dp-_ and Tron)
20 years ago
truelight 49d69f6fa3 (svn r2041) -Fix: not all vehicles did get a day_proc call (because of rounding errors) 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
tron eea2dc6c78 (svn r1979) Const correctness 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
tron 391cd5658f (svn r1875) Effect vehicle overhaul: enumerate sprites, descriptive names for functions and miscellaneous improvements 20 years ago
tron 2b4b935351 (svn r1869) Fix some bugs in the bulldozer movement implementation.
Now they move in a sane pattern.
20 years ago
tron 8391c96fac (svn r1868) Improve readability of the bulldozer movement code 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
tron 7cd19fe07a (svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate 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
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 f183ca5cc2 (svn r1783) -Add: Dynamic vehicles (now up to 64k of vehicles) 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
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 3c82a2b3c7 (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 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
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
bjarni 7b242e2ea9 (svn r1690) - Fix: [autoreplace] Cheaters can no longer exploit autoreplace to get vehicles, that's not invented yet
- Fix: [autoreplace] Fixed a stupid bug introduced in r1687, that made a crash if anybody tried to autoreplace anything but an aircraft
20 years ago
bjarni 1d4de01a63 (svn r1687) - Feature: [autoreplace] server now checks for plane<->helicopter replacement and reject replacement if needed 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 879ca66041 (svn r1640) fix: now helicopters will use a hangar in schedule to be replaced in, even if they are only set to service there. Since helicopters are serviced at helipads, they will only go there if they needs to be replaced or renewed. 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
truelight b586a890f7 (svn r1612) -Fix: made sure that ->next pointers are set to NULL 20 years ago
tron 81ee2d931b (svn r1610) Remove trailing whitespace (last time ever, i hope) 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
darkvater 0d43eb3ab8 (svn r1583) -Fix: You should no longer be able to delete bridges on any type of underground when there is a vehicle on it 20 years ago
darkvater ada9fc873e (svn r1569) -Fix: signed/unsigned mismatch 20 years ago
bjarni 467e4b82bf (svn r1568) made an enum of train subtypes to make the code more readable 20 years ago
tron 654d75f795 (svn r1564) ISO C90 forbids mixed declarations and code (bad bjarni, no cookie) 20 years ago
bjarni 75863ee5cd (svn r1563) fix: autoreplaced trains now sets wagon override properly 20 years ago
bjarni 5f549396f4 (svn r1561) Fix: autoreplacing a singleheaded engine into a dualheaded 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
20 years ago
tron 0d85b92e43 (svn r1559) Use IsTileType() instead of bit shifting and comparisons 20 years ago
darkvater 0fc9b656e2 (svn r1538) -Feature: [988816] Disable servicing when breakdowns set to none (jaguar7) 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
truelight 3e84b9781f (svn r1448) -Fix: The current_order of a vehicle is now correctly saved (caused
massive desyncs)
  Warning: savegames which are made with the nightly of 08-01-2005 will 
   NO LONGER work!!
20 years ago
truelight 95a879fb7d (svn r1429) Change: bumped savegame to revision 5.
- Now orders are bigger
   - Now _map2 is official 16 bits
20 years ago
bjarni 4068eba111 (svn r1427) fixed issue where the wrong sprite could be used if autoreplacing between single and multiheaded trains 20 years ago
truelight 1d9d128f65 (svn r1426) -Codechange: cleaned up the reference code in the saveload routines
-Codechange: removed next_in_chain_old, and saved ->next for Vehicles
  (and bumped savegame revision for that to version 4.4)
-Codechange: Added _sl.full_version, which has both major and minor version
20 years ago
bjarni 2b6e6a3846 (svn r1421) improved autoreplace multiheaded trains. It now remembers the current heading for an engine instead of turning all of them like the first one and the last the other way 20 years ago