Commit Graph

178 Commits

Author SHA1 Message Date
tron af70b49bf7 (svn r3367) Unify the 4 distinct CMD_CHANGE_{AIRCRAFT,ROADVEH,SHIP,TRAIN}_SERVICE_INT commands into one CMD_CHANGE_SERVICE_INT command.
As side effect this is a
-Fix: The default AI tried to change the service intervals of vehicles via the CMD_CHANGE_TRAIN_SERVICE_INT command - regardless of the type of the vehicle - which of course failed for non-trains
2006-01-05 21:35:54 +00:00
peter1138 1ffc700797 (svn r3352) - NewGRF: Move initialization of vehicle random_bits to DC_EXEC blocks to allow use of Random() instead of InteractiveRandom(), which will alleviate some possible network desyncs. 2005-12-28 22:29:59 +00:00
tron 23bfc03054 (svn r3297) Staticise 2005-12-14 06:20:23 +00:00
peter1138 fde99748c0 (svn r3248) - Codechange: Change interface of CanRefitTo() to supply the engine type directly instead of getting it from a vehicle. This allows the function to be used before vehicles are involved. 2005-11-29 22:29:59 +00:00
peter1138 87f54ebf92 (svn r3239) - Codechange: Introduce and use helper functions for engine replacement code. 2005-11-26 16:41:14 +00:00
tron 8cebe2f607 (svn r3204) Make handling of clicking on vehicles a bit less ugly by avoiding function declarations in .c files and unnecessary indirection 2005-11-16 12:52:01 +00:00
tron ce9cbb9c47 (svn r3196) Use structs instead of magic offsets into arrays 2005-11-16 12:01:46 +00:00
tron f7abff5f96 (svn r3181) -Bracing
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
2005-11-14 19:48:04 +00:00
tron 833032adc0 (svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT 2005-11-14 08:09:57 +00:00
tron ee15e3de13 (svn r3172) static, const 2005-11-13 13:43:55 +00:00
bjarni 5e278b7ec3 (svn r3156) -Fix: removed some cases where autoreplace windows were redrawn when nothing was changed
due to the FOR_ALL_VEHICLES(), redrawing those windows are slow
2005-11-08 23:18:09 +00:00
bjarni d86829d0e0 (svn r3138) -Fix: [clone vehicles] fixed assert when it was possible to allocate some vehicles to clone a train, but not for all cars
Now it gives "too many vehicles" error message instead
	To make this work, AllocateVehicles() needed to be moved to vehicle.c (from aircraft_cmd.c) and made non-static
2005-11-05 14:01:00 +00:00
bjarni 682b9ee8e4 (svn r3111) -Fix: [autoreplace] [ 1341783 ] Assertion failure in vehicle.c line 378
running MaybeReplaceVehicle() is now delayed until after the loop in CallVehicleTicks()
	This avoids selling the vehicle the loop currently works with (and continues to work with afterwards)
2005-10-31 12:59:47 +00:00
bjarni 1ef02f8cca (svn r3105) readded 2 line that should not have been removed in last commit(3104). Now cargo are removed when refitting (like it should) 2005-10-30 15:50:08 +00:00
bjarni c406487b14 (svn r3104) -Codechange: [refit] removed now obsolite code that the old autoreplace needed 2005-10-30 11:00:54 +00:00
bjarni 6d41c23cf2 (svn r3101) -Codechange: added _new_vehicle_id
this var works like _new_train_id and the rest of that kind of vars, except it is set each time a vehicle is build, nomatter what type
	this is a nice tool to code vehicle independent code, which in turn can reduce code duplication
	Right now it's used in ReplaceVehicle() and CmdCloneVehicle()
2005-10-29 21:54:28 +00:00
tron 9e957ff80b (svn r3098) static, const, uint -> TileIndex, indentation, bracing, unused return values, ... mostly related to the clone vehicle GUI 2005-10-28 20:04:54 +00:00
bjarni bf467bd99c (svn r3081) -Codechange: [autoreplace] complete rewrite of autoreplace
this is a complete rewrite, that makes use of existing commands like build and sell
        this means that multiheaded train engines are replaced correctly
2005-10-24 19:40:48 +00:00
tron 47137cefb7 (svn r3078) Some more stuff, which piled up:
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
2005-10-23 13:04:44 +00:00
tron d5042d4ab2 (svn r3046) Replace some numbers with sprite names and fix a typo in the sprite list 2005-10-15 11:06:54 +00:00
tron 9fea263c77 (svn r3030) More work for GB/SB, this time concerning the waiting_acceptance attribute of stations 2005-10-11 13:54:21 +00:00
tron db3b1228bf (svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them 2005-10-03 21:20:01 +00:00
tron 0cc45ecd8e (svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, plus some related changes (mostly casts) 2005-10-01 12:43:34 +00:00
tron ed8c9c91d6 (svn r3001) s/Player*/const Player*/
s/byte/PlayerID/
s/int/PlayerID/
and related changes
2005-09-30 20:37:25 +00:00
peter1138 fbf06041ca (svn r2990) Remove _engine_original_sprites and replace all uses with references to our (new) original engine/vehicle tables. 2005-09-26 19:01:49 +00:00
Darkvater 236abb6a6c (svn r2949) The AI no longer needs to 'cheat' to build aircraft; eg it builds them now from a hangar. Also, to query the price of a new aircraft tile information is not needed 2005-09-13 13:30:18 +00:00
truelight 2e87864d0b (svn r2948) -Fix: the old AI needs a special flag that triggers all kind of special
abilities you really don't want to know about (free bridges, etc..)
       I removed this flag some revisions ago, but the Aircraft part
       depends on it, so I re-enabled it again..
2005-09-13 12:19:27 +00:00
tron f914a7eca6 (svn r2890) Fix some signed/unsigned comparison warnings (tokai) 2005-08-25 16:53:51 +00:00
ludde 062ed26b4d (svn r2842) Fix bug with aircraft autoreplace (peter1138) 2005-08-08 15:26:53 +00:00
bjarni ed8e2bac04 (svn r2817) -Codechange: [autoreplace]: moved autoreplace and autorenew to serverside
-This means that one company can only have one setting for renew and replacing
    more clients will not fight due to different settings anymore
  -This is a needed step in the line to fix autoreplacing dualheaded locomotives
  NOTE: savegame revision bump (peter1138 + me in coop)
2005-08-06 16:07:22 +00:00
bjarni 546c34f2e5 (svn r2764) -Feature: Clone vehicles
-This allows a player to clone an excisting vehicle of his own
  -[fix]: this uncovered an excisting bug in CmdBuildRailVehicle() where depots could build trains of the wrong track type. This is fixed
  -Thanks to Celestar for drawing the sprites and _luca_ for including them in openttd.grf
2005-07-31 13:08:08 +00:00
celestar 21ed40bc53 (svn r2732) -Codechange: Cleaned the order flags some more. Hit some inconsistencies while trying to locate bug 1244167 2005-07-28 06:09:15 +00:00
tron a227065ab7 (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron 559babcdc9 (svn r2673) Include functions.h directly, not globally via openttd.h 2005-07-22 07:02:20 +00:00
tron ac66e3e28f (svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read 2005-07-20 15:29:28 +00:00
tron 7c694f2553 (svn r2643) Get rid of some unnecessary casts 2005-07-19 21:49:35 +00:00
tron 8c1d74162f (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes. 2005-07-13 18:04:01 +00:00
tron b64c9b8b1f (svn r2504) Move Draw*EngineInfo to engine_gui.c to reduce dependencies 2005-07-01 14:05:44 +00:00
tron 61f6f07edd (svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY 2005-06-25 06:15:43 +00:00
tron 3154e7148d (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile" 2005-06-24 12:38:35 +00:00
tron fa8f46c0b7 (svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[] 2005-06-07 18:13:49 +00:00
tron 0c4ecbe9ec (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner 2005-06-04 11:56:32 +00:00
tron 6933aaa210 (svn r2403) if cascade -> switch 2005-06-03 22:25:06 +00:00
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +00:00
Darkvater 00cf2eae38 (svn r2383) - Fix: Monkey-testing turned up some command crashes. 2005-05-30 14:45:36 +00:00
orudge e06c121d78 (svn r2380) - Fix: Build year for mail compartment of planes was not set correctly, affected station ratings (Asterix_) 2005-05-30 10:18:18 +00:00
Darkvater 5174d3adfe (svn r2306) - CodeChange: Check the last commands; refits. This needed an extensive rewrite and global/local-cargo ID juggling and bitmasking. However with this done it looks better as well and is compatible with newgrf handling. Big thanks to HackyKid for doing most of the work. This also closes patch "[ 1199277 ] Command checks" 2005-05-14 12:36:16 +00:00
Darkvater 921cc4e94a (svn r2297) - CodeChange: server-check the next batch of commands.
- CodeChange: since only the server will be able to modify difficulty settings, leave the checking of correct values besides, and trust users will join legit servers.
- CodeChange: for renaming signs, only check if GetDParam(); eg _decode_parameters is empty ('\0') or not, instead of the extra check of players, etc. That basically does the same thing. Also dirty sign two times when renaming, once before, once after the action. Because if the name becomes shorter and you update only after, garbage remains on the screen.
- CodeChange: made GetMaskOfTownActions() available to the town-cmd to double-check if the action was available to the player. For this purpose the hardcoded _local_player has been removed from the function and is now passed as a parameter.
2005-05-12 00:11:37 +00:00
Darkvater 729066e407 (svn r2294) - CodeChange: check the service interval settings when changing of all vehicle-types. To simplify things introduce GetServiceIntervalClamped() that returns the same or clamped value of the new service interval. There were some inconsistencies in the gui files so I had to change those, and const correctness kicked in, so it's a bit messy at certain points. 2005-05-11 16:17:03 +00:00
Darkvater 5e6923e936 (svn r2290) - CodeChange: protect the next batch of commands. This brings us to a total of 61, which is 53% :)
- CodeChange: To correctly accept engine-prototypes, the best-player checking has been moved to its own function, I hope it functions the same as before.
- CodeChange: Added symbolic types of PlayerID, OrderID and EngineID. For engines also added GetEngine() and IsEngineIndex(), similar to the other such functions.
- CodeChange: To correctly build industries, some tables have been moved to build_industry.h. The only way to find out currently if an industry is valid in a climate is by looping all industries and checking if it matches. Also to comply with the patch setting build_rawmaterial_industries, it is assumed that these industries do not accept any cargo of any type. This can and probably should changed in the future to some flag in their struct. Also use _opt_ptr instead of _opt.
- CodeChange: implemented the HQ checking code inspired by MarkR2 in "[ 1190944 ] Many commands not checked for security".  Unfortunately it is impossible to prevent only deleting a HQ by a modified client atm.
- CodeChange: For insert order and modify order their parameters are implicitely truncated to 8 bits, instead of the 16 bits said in the comments.
2005-05-11 00:00:27 +00:00
matthijs 6eb094c726 (svn r2256) - Fix: Trains cannot find a depot when they are in a tunnel. (glx)
- 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-05-02 23:59:11 +00:00
Darkvater 35ff9d850c (svn r2118) - Fix: Fix compilation with network disabled, and comment out some of the warnings (unused function) 2005-04-02 00:17:16 +00:00
tron 22c4924040 (svn r2037) uint -> TileIndex, remove pointless casts, const, misc. 2005-03-23 11:54:20 +00:00
tron 04087c9ac9 (svn r2036) Fix FindNearestHanger(), it never worked correctly because 0xFFFF != 65000 and a 16bit number has no 17th bit
While here also do some const gymnastics
2005-03-23 11:12:17 +00:00
celestar fbc2eacade (svn r2034) -Codechange: Replaced the rather meaningless LOAD and UNLOAD flags for depots by something more meaningful 2005-03-20 08:43:29 +00:00
bjarni acb1fb2e30 (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)
2005-03-19 21:16:22 +00:00
Darkvater 1f66d60272 (svn r1905) - Fix: [ 1118810 ] openttd: ship_cmd.c:642 ... Assertion failed. Mapwrap fixed in ship_cmd.c (was implicitely ok before biggermaps).
- CodeChange: rename all vehicle controllers to ...Controller for their similar behaviour
2005-02-22 19:38:44 +00:00
tron 6b83a05ada (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
2005-02-12 15:53:32 +00:00
tron f0f85a7ef3 (svn r1803) Move debugging stuff into files of it's own 2005-02-05 15:58:59 +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 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 03095f85bc (svn r1767) fixed mixed declarations and code in last commit (oops) 2005-02-01 22:17:38 +00:00
bjarni 5c43906b24 (svn r1766) - Feature: Aircrafts will now go to the nearest hangar if the next airport in the orders do not have one (helipads)
- Fix: sometimes aircrafts would not go to the hangar even when they should. They do now
2005-02-01 22:04:53 +00:00
tron 7bbcf5875c (svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names 2005-01-31 07:23:15 +00:00
bjarni 1c109afdaa (svn r1742) - Fix: fixed bug introduced in r1730 where AI players had problems when building aircrafts 2005-01-30 21:06:09 +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
darkvater 55e1eab1a2 (svn r1739) - Fix: type checking when selling vehicles (TrueLight) 2005-01-30 18:51:08 +00:00
bjarni 307c27892d (svn r1730) - Fix: Ships and Aircrafts have to be build in depots owned by _current_player (hacked client protection)
now all 4 types of vehicles have to be build in depots. Note: there is a wordaround for AI players since the AI handle aircraft building in a weird way
2005-01-30 14:52:04 +00:00
tron 5885b31bb4 (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 2005-01-29 12:19:05 +00:00
bjarni db4721a31d (svn r1710) - Fix: [autoreplace] vehicles do no longer go to a depot all the time if the owner clicked 'stop replacing' ( ship+aircraft+road vehicles ) 2005-01-29 01:02:47 +00:00
bjarni 41ca1be4ff (svn r1708) - Fix: FindNearestHangar() will no longer return a hangar where a jet will crash if it is a jet, that is searching
- Codechange: Since planes move in strait lines in 8 directions, GetTileDistAdv() is used instead of manhatten distance in FindNearestHangar()
2005-01-28 18:10:12 +00:00
dominik 5856325e5a (svn r1704) - Fix: [newgrf] rotors of custom helicopters are displayed correctly in the hangar window 2005-01-28 12:20:06 +00:00
tron 3e0dcfd47f (svn r1701) Style police ^^ 2005-01-27 21:18:03 +00:00
bjarni 99338d278d (svn r1700) - Fix: Hacked clients can no longer be used to build vehicles that are not available yet (Hackykid) 2005-01-27 21:00:05 +00:00
bjarni 1ae9e7b448 (svn r1699) - Feature [autoreplace] a plane will now go to the hangar right after landing if it needs to be replaced
- Fix     [autoreplace] fixed a typo that could prevent autoreplaced aircraft from automatically go to a hangar
2005-01-27 20:38:19 +00:00
bjarni 14f0cb2704 (svn r1698) - Feature [autoreplace] helicopters will now go to the nearest hangar if they are set to autoreplace and don't have any airport with a hangar in
schedule
2005-01-27 15:43:44 +00:00
bjarni e006f89aa3 (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)
2005-01-24 22:24:47 +00:00
dominik ffb2c4de77 (svn r1651) Fix: [ 1098696 ] Airport shadow remains after crashing 2005-01-24 22:09:20 +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
bjarni 6dc99f7738 (svn r1636) fix: helicopters now go to a hangar if they are set for replacement or needs to be renewed 2005-01-24 10:50:57 +00:00
bjarni 6510b12203 (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
2005-01-23 22:01:51 +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
celestar 941da5dc94 (svn r1565) -Fix: [ 1104969 ] Aircraft in hangar messages are now revalidated before
display
-CodeChange: replaced one if (foo) return true else return false by
return (foo)
2005-01-19 10:00:37 +00:00
Celestar 5bcf3d2bc0 (svn r1556) -Fix: Vehicle list updates should now really work 2005-01-18 09:35:31 +00:00
celestar e0471187d0 (svn r1554) -Fix: [ 1103187 ] Order Check messages are now validated before
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 21:54:45 +00:00
truelight 8e404a26f6 (svn r1544) -Fix: SwapOrder did not use AssignOrder, which caused the saveroutine to
crash from time to time
-Codechange: added const before 'Order *' where possible
2005-01-16 14:42:53 +00:00
tron ae796740aa (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts 2005-01-16 11:24:58 +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
tron 3279a7c9a2 (svn r1520) Trim 134 (!) lines with trailing whitespace ): 2005-01-15 08:58:31 +00:00
celestar 7f7c6297f7 (svn r1519) -Fix: [1102776], [1099535] Aircraft vehicle lists are now redrawn when an aircraft arrives in the depot. Station-specific vehicle lists are now redrawn daily as well (not only the master list) 2005-01-15 08:40:32 +00:00
celestar e17a8989cf (svn r1440) -Feature: Allows more flexible airport layouts now, as the number of
terminals in every group can be freely chosen
-Codechange: AT_OILRIG is now 15, so that new airports can be added
easily.
2005-01-09 08:49:40 +00:00
tron 7ca6b2b8b0 (svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY] 2005-01-07 17:02:43 +00:00
celestar 9a4465f9c0 (svn r1412) -Feature/Fix: Aircraft refit options have been restricted to "sane"
values.
-Feature: aircraft can now be refitted "mail-only"
-Feature: Passengers aircraft now ignore the amount of mail for "full
load any" options
2005-01-07 09:51:16 +00:00
celestar 8ed132a5b9 (svn r1410) Replaced all occurences of 'passanger' by 'passenger' in the code 2005-01-07 08:38:27 +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 f8c95a1dbe (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff 2005-01-06 11:39:00 +00:00
dominik 6735135773 (svn r1387) Fix: Airplanes now also crash when only one invalid order is in the schedule 2005-01-05 13:48:38 +00:00
dominik 2543158c8e (svn r1385) Fix: [ 1095020 ] When all stations in an aircraft's order list are demolished, the plane eventually crashes (running out of fuel) 2005-01-05 13:15:27 +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