Commit Graph

296 Commits

Author SHA1 Message Date
rubidium 622a4d10b9 (svn r10056) -Revert (r10049): removing SLE_WRITEBYTE didn't work as expected :(. Somehow SlIterateArray and SlObject depend on eachother and adding a some arbitrary data before the SlObject makes it go crazy. 2007-06-07 12:37:48 +00:00
rubidium eab8ac49ce (svn r10049) -Codechange: get rid of the SLE_WRITEBYTE obfuscation. 2007-06-06 23:57:21 +00:00
peter1138 07c34b2628 (svn r10048) -Fix (r6455): Don't use override engine type for articulated wagon parts. 2007-06-06 10:51:11 +00:00
maedhros 8f361393dd (svn r10020) -Fix [FS#824]: GetNextVehicle() is invalid for anything that isn't a train. 2007-06-02 09:11:06 +00:00
maedhros 4acf3e4c3f (svn r10009) -Codechange: Add and use Vehicle::IsPrimaryVehicle to replace individual checks depending on the vehicle type. 2007-06-01 12:03:10 +00:00
maedhros 710cc5a597 (svn r9959) -Fix: Only call GetNextVehicle for trains. 2007-05-27 17:27:07 +00:00
peter1138 974aebcce5 (svn r9956) -Codechange: Add tram livery schemes 2007-05-27 09:33:41 +00:00
maedhros 1b33f19877 (svn r9953) -Fix: Only check whether trains are multiheaded when cloning. 2007-05-27 05:32:37 +00:00
maedhros 3914f3c85c (svn r9939) -Fix (r3139): EngineHasArticPart(v) is only valid for trains. 2007-05-26 17:06:45 +00:00
rubidium 0819f3a9a0 (svn r9917) -Codechange: prepare some more areas for more road types. 2007-05-25 08:13:01 +00:00
rubidium 440d723d84 (svn r9914) -Codechange: prepare GTTS and the pathfinders to handle multiple road types on a single tile. 2007-05-24 22:41:50 +00:00
glx 0646d307bd (svn r9896) -Fix (r9874): when selling an entire train, decrease the number of vehicles in the group only once 2007-05-21 17:19:01 +00:00
peter1138 546dfc2758 (svn r9889) -Codechange: Use cargo's freight status for choosing livery scheme. 2007-05-20 10:27:43 +00:00
rubidium 4570a8954a (svn r9878) -Fix (9874): some vehicle count's were not properly updated on delete or autoreplace of vehicles. 2007-05-19 12:29:09 +00:00
rubidium 7d4be11516 (svn r9874) -Feature: advanced vehicle lists a.k.a. group interface. Now you can make groups of vehicles and perform all kinds of tasks on that given group. Original code by nycom and graphics by skidd13. 2007-05-19 09:40:18 +00:00
rubidium 5178911345 (svn r9872) -Codechange: more type strictness for vehicle types 2007-05-18 23:38:29 +00:00
rubidium ba24c34f85 (svn r9869) -Codechange: replace some bytes with VehicleType, i.e. more type strictness. 2007-05-18 17:31:41 +00:00
truelight 765c466b8d (svn r9846) -Codechange: introduced ZOOM_LVL_MIN and ZOOM_LVL_MAX for the obvious reasons
-Codechange: introduced ZOOM_LVL_DETAIL to show/remove details
-Codechange: changed << and >> operator with ZoomLevel to a simple wrapper (that in theory also allows zoom-in besides the current zoom-out)
-Fix r9845: missed some int -> ZoomLevel
2007-05-15 16:08:46 +00:00
rubidium 23492f1f34 (svn r9841) -Codechange: add a little more type strictness to the vehicle types. 2007-05-15 11:28:22 +00:00
rubidium c7d57379fb (svn r9836) -Codechange: make non-improved loading happen FIFO-ish; generally loading/unloading will happen fifo, but there are no guarantees on the FIFO-ness. For (better) FIFO guarantees you still need to use improved loading. 2007-05-14 16:07:05 +00:00
rubidium d78651f7b1 (svn r9831) -Codechange: more refactoring of the loading/unloading. 2007-05-13 21:24:58 +00:00
rubidium 2efecd34c4 (svn r9808) -Codechange: unify the Handle<VehicleType>Loading functions. 2007-05-07 16:21:34 +00:00
rubidium fe1306ce65 (svn r9799) -Codechange: separate engine class and engine running cost class (mart3p). 2007-05-06 19:44:22 +00:00
rubidium 5c0a52149d (svn r9795) -Codechange: enumify the EngineClass. 2007-05-06 15:01:44 +00:00
rubidium abbaa1691e (svn r9794) -Codechange: refactor the question whether a vehicle can be loaded into LoadUnloadVehicle instead of duplicating it for each vehicle. 2007-05-06 14:59:01 +00:00
rubidium 438d55d576 (svn r9789) -Fix (r9770): vehicles didn't get unloaded when 'full load' was specified and the vehicle was already full when it entered. 2007-05-05 09:51:26 +00:00
rubidium b76cc8c96b (svn r9784) -Codechange: remove unused variable. 2007-05-04 22:38:36 +00:00
glx a7c39f7325 (svn r9773) -Fix r9772: MSVC warning 2007-05-03 17:07:51 +00:00
rubidium 9194d5ab9e (svn r9772) -Fix [r9770,FS#761]: under some circumstances loading/unloading didn't work (correctly). 2007-05-03 11:02:37 +00:00
rubidium 981bf52bdd (svn r9770) -Codechange: perform the payment of cargo when loading/unloading, but when arriving at the station. 2007-05-02 18:29:11 +00:00
rubidium dce7dcb664 (svn r9764) -Codechange: replace some lookup tables by functions. 2007-05-02 09:29:41 +00:00
rubidium 1bea3b55a6 (svn r9763) -Codechange/Fix (r9760): don't read the variables that are calculated automatically either. 2007-05-01 18:17:52 +00:00
rubidium a4e045a3fb (svn r9760) -Codechange: remove the need for saving some vehicle variables. 2007-05-01 16:35:14 +00:00
rubidium ec9ac99d01 (svn r9755) -Codechange: refactor some more of the begin loading stuff. 2007-04-29 22:33:51 +00:00
rubidium 202009522c (svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches. 2007-04-29 21:24:08 +00:00
rubidium 6440440f12 (svn r9752) -Codechange: remove some duplication related to BeginLoading. 2007-04-29 18:21:24 +00:00
maedhros 02e770ff2c (svn r9742) -Fix (r9689) [FS#739]: Fix cloning with refit costs again, hopefully for good this time. 2007-04-29 08:43:00 +00:00
peter1138 1164c275af (svn r9714) -Fix (r8110): Remove invalid assertion triggered by overly long trains being reversed while loading. 2007-04-24 19:05:16 +00:00
peter1138 15bfaba259 (svn r9702) -Codechange: Add livery support to newgrf vehicle var 43 2007-04-20 21:21:47 +00:00
rubidium 17dc1c6336 (svn r9692) -Fix (r9683): don't try to remove vehicles from the queue of a non-existing station. 2007-04-20 17:52:28 +00:00
bjarni aa0e97e3ce (svn r9689) -Fix: Clone vehicles will no longer refit for free 2007-04-20 17:08:55 +00:00
maedhros 8b65349d86 (svn r9684) -Fix (r9683): Remove vehicles from the station loading list instead of adding
them again when they leave, and add a v->LeaveStation() call for aircraft.
2007-04-20 11:05:56 +00:00
rubidium fdf86bb4a2 (svn r9683) -Fix [FS#423]: improved loading does not use a huge amount of processing power anymore when having a lot of trains. 2007-04-20 08:00:30 +00:00
rubidium 2dc5589290 (svn r9673) -Cleanup: remove spaces before tabs and replace non-indenting tabs with spaces. 2007-04-18 22:41:53 +00:00
rubidium 80c259f64f (svn r9672) -Cleanup: lots of coding style fixes around operands. 2007-04-18 22:10:36 +00:00
peter1138 41cf2fa69b (svn r9671) -Codechange: Implement NewGRF callback 36, which allows changing of various properties which were previously static. Vehicle max speed and train power/te/running costs are adjustable. 2007-04-18 18:37:40 +00:00
belugas d6651c1741 (svn r9665) -Documentation: Doxygen corrections,errors, corrections of corrections... 2007-04-18 00:41:09 +00:00
maedhros ccaaa7d33a (svn r9609) -Codechange: Move some function prototypes out of functions.h and into landscape.h, and add a few where they didn't exist. 2007-04-12 13:07:15 +00:00
maedhros afc3da5fc8 (svn r9581) -Revert (r9562): This broke as much as it fixed, so revert until a proper way of paying for refits when cloning can be found. 2007-04-10 09:01:56 +00:00
maedhros abf88b687c (svn r9562) -Fix: When cloning, pay for the refit costs as well. 2007-04-04 14:21:46 +00:00
belugas a1b7fb8909 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that... 2007-04-04 04:08:47 +00:00
peter1138 d7f56f1550 (svn r9388) -Codechange: variable scope and type, and standardify all CargoID loops. 2007-03-21 13:19:01 +00:00
peter1138 ae48a7447b (svn r9303) -Codechange: Use cargo class when counting passengers in a road vehicle crash, and when loading aircraft. 2007-03-18 22:32:05 +00:00
peter1138 8ef0e43b94 (svn r9302) -Codechange: Use cargo class to test for passengers when deciding on the livery scheme to use. 2007-03-18 22:11:24 +00:00
bjarni f776f3beb1 (svn r9073) -Codechange: moved autoreplace to a file of it's own (now autoreplace has a cmd and a gui file) 2007-03-08 23:05:05 +00:00
rubidium ce919e8c71 (svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code). 2007-03-08 16:27:54 +00:00
rubidium 24c4d5b06d (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {}; 2007-03-07 12:11:48 +00:00
rubidium 36bb92ae24 (svn r9050) -Codechange: Foo(void) -> Foo() 2007-03-07 11:47:46 +00:00
richk d11e36e477 (svn r8978) -Feature: Rewrite of transfer system.
This major feature-fix keeps track of the value of transfers offloaded at a station, and hands on to a loading vehicle a credit note proportionate to the cargo loaded. The transferring vehicle is paid only for the distance it has travelled. eg. B-C in a transfer chain A-B-C-D.
When the final cargo is delivered, these credit notes are cashed, and the final vehicle is paid for A-D minus any credit notes it is carrying. The company bank balance increases by the value of the A-D route.
You still need to set up a profitable route; it is still easy to make a loss on transfers by bad planning. :)
2007-03-02 18:49:11 +00:00
maedhros aadd8a4b44 (svn r8945) -Codechange: Rename v->load_status to v->vehicle_flags so it can be used for more than just the gradual loading status. 2007-02-28 17:18:36 +00:00
tron 1ce43c1a37 (svn r8897) -Fix
Change the signature of GetNewVehiclePos():
-void GetNewVehiclePos(const Vehicle *v, GetNewVehiclePosResult *gp);
+GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v);
2007-02-25 10:49:13 +00:00
tron 696b895b77 (svn r8896) -Fix
Most (i.e. 13 of 15) callers of GetNewVehiclePos() do not care for the return and the others can figure it out by inspecting the information returned in struct GetNewVehiclePosResult.
Therefore remove the return value.
2007-02-25 10:25:25 +00:00
peter1138 4c4b035175 (svn r8891) -Codechange: Remove remains of global cargo scheme. All cargo mapping is now dealt with only in NewGRF code, on load where possible. 2007-02-24 23:36:40 +00:00
peter1138 6062004960 (svn r8849) -Codechange: Replace hardcoded global/climate cargo mapping tables with dynamically generated data. Change associated code to use new functions. 2007-02-22 22:09:51 +00:00
tron 103d119c51 (svn r8841) -Fix
Remove {,u}intswap() and replace them by Swap()
2007-02-22 08:43:02 +00:00
bjarni 790a3f5d5e (svn r8777) -Fix: FS#596 Cloning Maglev in UKRS forgets Mail refit
Cloning were unaware that articulated locomotives could refit without refitting the front unit
2007-02-17 13:50:22 +00:00
celestar 6abbf15a8e (svn r8744) -Fix(r654/2105): Call GetFirstVehicleInChain only for trains, and assert the vehicle type in that function. Not a critical error, but it does increase game performance by up to 10% when playing a large game (many vehicles) with aircraft/road vehicle newgrfs loaded. 2007-02-15 10:21:00 +00:00
rubidium 0e8f006dc1 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p. 2007-02-14 16:37:16 +00:00
rubidium 447b16930e (svn r8730) -Codechange: more replacements of magic numbers by enums and removal of some (by now) redundant comments. 2007-02-14 10:33:36 +00:00
rubidium 154dff9873 (svn r8715) -Codechange/cleanup: replace magic numbers related to state of road vehicles with enums. Original patch by mart3p. 2007-02-13 22:27:27 +00:00
rubidium 4ec7eb2201 (svn r8701) -Codechange: replace magic numbers with enums for u.rail.track. 2007-02-13 10:46:45 +00:00
rubidium a419f4aeda (svn r8698) -Codechange: enumify the returns of VehicleEnterTile 2007-02-13 10:26:53 +00:00
bjarni 037d636734 (svn r8621) -Codechange: assigned new numbers to the VEH_(type) enum so that VEH_Train is 0, VEH_Road is 1 and so on
This means that "v->type" can be used as array indexes instead of VehTypeToIndex() (or "v->type - VEH_Train/0x10 as the code still used in some places)
  Surprisingly this can be done without changing the savegame format
2007-02-07 19:10:19 +00:00
bjarni 80125fd934 (svn r8610) -Codechange/Feature: rewrote the list handling in the autoreplace window
-The user will notice the following changes:
      All vehicle types behaves in the same way
      Adding/removing an engine (new design and so on) can no longer result in the window selecting a new engine
      All valid replacements will be displayed since it looks at refitting options as well (this solves the missing ships with the newships GRF)
      Since you can't replace an engine into itself, the engine selected in the left list will no longer appear in the right list

   -The code changes:
      Instead of looping all engines all the time, each list generates a list like the build windows
        This ensures consistent list generation since only one function can loop all engines
      Unified code for all vehicle types
      It now use the lists to call the drawing code in the build vehicle window
      Works on selected EngineIDs instead of selected index in the list
2007-02-06 11:11:12 +00:00
rubidium 1bf688e5b5 (svn r8593) -Fix (FS#564): bridges do not get destroyed when the bridge head gets flooded and there is a vehicle on the bridge. Original patch by KeeperofTheSoul. 2007-02-05 14:00:32 +00:00
maedhros d8edc2bb98 (svn r8501) -Fix (r7377) [FS#539]: Keep track of how much cargo has been paid for, so that cargo cannot be paid for more than once. 2007-01-31 22:33:24 +00:00
belugas 0c45071bb0 (svn r8455) -Codechange: Give a more meaningful name (railveh_type)to member flags of RailVehInfo, as well as changing the code to reflect the fact that it was not a flag but rather a one value only variable. Doing so, some evaluations have been simplified.
-Codechange: Add and use RAILVEH_SINGLEHEAD when railveh_type is set to 0, which was implicit before.
-Cleanup: Remove some extraneous parenthesis.
2007-01-30 11:53:35 +00:00
Darkvater 39a50e3723 (svn r8448) -Codechange/Fix (r2993): Also update the helicopter's rotor when loading the game. This can solve crashes when a game is loaded with missing GRF's 2007-01-28 21:53:13 +00:00
Darkvater 08c21c0c61 (svn r8429) -Codechange: Add a name for AircraftVehicleInfo subtype helicopter and remove some magic numbers related to the subtype. 2007-01-27 12:45:55 +00:00
Darkvater 50ca901b40 (svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow. 2007-01-27 12:29:55 +00:00
tron 0996de79df (svn r8385) -Fix
-Regression (r8314): I only did half the necessary changes to move railtype from Engine to RailVehicleInfo. Now do the rest.
2007-01-24 07:14:09 +00:00
bjarni edf2f70565 (svn r8353) -Cleanup: added IsPlayerBuildableVehicleType() to autoreplace code (duplicated code removal) 2007-01-22 16:48:36 +00:00
bjarni 8de4196410 (svn r8349) -Codechange: replaced CMD_REFIT_VEH() and similar defines with real static inline functions 2007-01-22 16:16:52 +00:00
tron bc523186e0 (svn r8314) -Fix
-Codechange: Move the railtype from EngineInfo to RailVehicleInfo, because having a railtype for non-rail vehicles isn't that useful
2007-01-21 16:08:18 +00:00
bjarni 59e6e762b8 (svn r8296) -Fix: GenerateVehicleSortList() tried to put a TileIndex into an uint16
-Fix: CmdMassStartStopVehicle() tried to put a TileIndex into an uint16
  Those two bugs were unrelated to each other and unrelated to r8295, even though that commit touched the code in question
2007-01-21 01:25:59 +00:00
bjarni 518c4cdfce (svn r8295) -Cleanup: merged arguments station, order and depot_airport_index for GenerateVehicleSortList() and BuildVehicleList() into one uint16 argument
It turned out that all 3 arguments were the same at all the places those functions are called, so there was no point in having more than one
2007-01-21 01:07:15 +00:00
bjarni 7871ce1879 (svn r8294) -Fix: deleting a vehicle with shared orders, but no orders would fail to reset prev_shared and next_shared
-As a result, vehicles in the game could end up having prev/next pointers to vehicles, that was no longer in the game
2007-01-21 00:13:39 +00:00
peter1138 004f1b061f (svn r8211) -Codechange: (NewGRF) Implement callback 2D, explicit vehicle colour map
selection.
2007-01-17 22:19:12 +00:00
rubidium f3796eee66 (svn r8157) -Fix (r3136): moving cargo during auto replaces did not update the cached vehicle weight for trains properly. This caused (in network games) the server to have a different cached vehicle weight than newly joined clients would have, which causes desyncs. 2007-01-16 15:45:20 +00:00
bjarni 0026ea84d1 (svn r8147) -Fix: [autoreplace] v->leave_depot_instantly was not always reset correctly
While it's not certain if this would have any serious sideeffects (or any at all), it's reset when intended now
2007-01-15 17:32:42 +00:00
celestar 05b783e551 (svn r8144) -Fix: [FS#163] When a station is removed, vehicles do not get excessive payment any longer, as the origin TILE is now stored as long as the origin STATION for the transported cargos. Basically this is only a temporary fix until cargopackets are implemented, but it fixes one of the oldest known bugs (Special Thanks to Darkvater for lots of testing) 2007-01-15 14:42:24 +00:00
peter1138 92d418b031 (svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
This lets us increase the sprite width from 14 to up to 29 bits, 
effectively nulling the old sprite limit. Table changes in next commit.
2007-01-14 19:57:49 +00:00
KUDr 9bfb3f08d9 (svn r8110) -Codechange: direct Vehicle::current_order.type changes (to OT_LOADING and OT_LEAVESTATION) replaced by v->BeginLoading() and v->LeaveStation() calls. This should allow easy hooking of those state transitions in order to maintain vehicle loading queue. 2007-01-13 18:55:54 +00:00
KUDr 33be1ecfb1 (svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter 2007-01-11 17:29:39 +00:00
rubidium f35ed4bbc2 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b. 2007-01-10 18:56:51 +00:00
KUDr e373ea7096 (svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp) 2007-01-10 18:12:09 +00:00
Renamed from src/vehicle.c (Browse further)