Commit Graph

38 Commits

Author SHA1 Message Date
matthijs c5c5c9b17c (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.
2005-02-06 22:36:08 +00:00
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)
2005-02-06 10:18:47 +00:00
truelight 97728357e4 (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)
2005-02-04 14:24:23 +00:00
truelight 42f98c7eec (svn r1783) -Add: Dynamic vehicles (now up to 64k of vehicles) 2005-02-04 13:23:29 +00:00
truelight ab3ed5c431 (svn r1770) -Fix: Hopefully last pieces of code that are containing a station-id
(and should be an uint16, not uint8)
2005-02-02 16:16:43 +00:00
bjarni 73c0cc5203 (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
2005-01-30 20:50:06 +00:00
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.
2005-01-29 19:41:44 +00:00
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!
2005-01-25 21:43:57 +00:00
bjarni 6e2abeba5e (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. 2005-01-24 18:21:23 +00:00
tron 189ca73707 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 2005-01-22 20:23:18 +00:00
bjarni 2fd3553d78 (svn r1568) made an enum of train subtypes to make the code more readable 2005-01-19 19:15:03 +00:00
bjarni b1c4b0f07d (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
2005-01-18 23:27:06 +00:00
Celestar 5bcf3d2bc0 (svn r1556) -Fix: Vehicle list updates should now really work 2005-01-18 09:35:31 +00:00
truelight d275109e79 (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!
2005-01-15 19:06:22 +00:00
celestar 02ed8410a2 (svn r1521) -Fix: Ship Vehicle Lists are now redrawn correctly
-Codechange: added some const to last commit
-Codechange: Ship and Aircraft lists are now update on order change, not
on new day
2005-01-15 09:28:08 +00:00
truelight 97479f9613 (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!!
2005-01-09 18:49:18 +00:00
truelight 32f480a4ae (svn r1445) -Fix: reversing a train also reverses the UP and DOWN status for 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-09 16:02:06 +00:00
truelight 788f543bc3 (svn r1429) Change: bumped savegame to revision 5.
- Now orders are bigger
   - Now _map2 is official 16 bits
2005-01-08 12:47:26 +00:00
truelight dcca3cf80b (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
2005-01-08 09:48:08 +00:00
truelight 63e97754fb (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns 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 22:31:58 +00:00
tron 29e71638ce (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows 2005-01-03 08:50:44 +00:00
bjarni 29d8c5bb50 (svn r1323) Adding autoreplace feature
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()
2005-01-02 17:23:04 +00:00
truelight c2ee8d70e4 (svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and 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-28 11:51:31 +00:00
truelight 8dcbf2675b (svn r1283) -Add: AutoRenew is now a client-side patch instead of a 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-27 18:18:44 +00:00
darkvater 160a0a5ee1 (svn r1211) -Feature: Introduce sticky windows to all vehicle windows...Just 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 23:27:58 +00:00
tron 0ba5123cef (svn r1015) MFM r789
Replaced the slightly misleading SERVICE_INTERVAL by a function VehicleNeedsService()
2004-12-11 10:17:10 +00:00
bjarni 02bf3ed5c0 (svn r998) now vehicles are serviced both when entering and when leaving depots to prevent that vehicles might need service when leaving after a long stay (ln--) 2004-12-09 21:46:56 +00:00
tron 93a4dbda4b (svn r990) Fix a display bug in the order list:
TTD stores invalid orders different than OTTD, this resulted in empty lines in the order list. With the overhaul of the order system this got worse: no line was shown at all.
Fix this by sanity checking while loading and convert the orders accordingly.
2004-12-09 18:18:21 +00:00
Celestar 6fd3fc10e3 (svn r978) Fixed an endianess issue with the new Order system. Thanks to Bjarni, Oskar and Tron 2004-12-08 15:26:57 +00:00
tron 7c2448ecea (svn r955) Replace uint16 for orders with struct Order
This adds no functionality, but is a stepping stone for future improvement (like 16bit order indices) and is easier to read.
This changes preserves binary compatibility wrt savegames.
2004-12-05 12:43:04 +00:00
tron 13f0b6c0cf (svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky) 2004-11-17 08:52:47 +00:00
darkvater 397cc50f61 (svn r587) -newgrf: Rename all /Checkpoint/i tokens to 'Waypoint's. The name actually makes some sense and is also compatible with TTDPatch (pasky). 2004-11-14 13:07:07 +00:00
truelight eb49a19460 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way! 2004-09-10 19:02:27 +00:00
darkvater bf0652d3fc (svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
-Fix: Sorter icon pointing down 'v' sorts in every window lowest value first, '^' highest value first
-CodeChange: move Dropdownlist from settings_gui.c to widget.c. More in place there.
2004-09-06 18:15:13 +00:00
darkvater 85628544ee (svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad) 2004-09-04 13:06:09 +00:00
darkvater f422014960 (svn r23) -Some omments on the code (blathijs) 2004-08-11 22:07:08 +00:00
dominik 6f8e7943c5 (svn r20) Feature: warning when a vehicle has invalid orders (celestar) 2004-08-11 10:15:38 +00:00
truelight efaeb275f7 (svn r1) Import of revision 975 of old (crashed) SVN 2004-08-09 17:04:08 +00:00