Commit Graph

156 Commits (e6116d11b8cfd58d1880e79143de93900404e33c)

Author SHA1 Message Date
rubidium 82e79b847e (svn r10200) -Codechange: add "shortcut" for !CmdFailed (CmdSucceeded). 17 years ago
rubidium 3ccc83e640 (svn r10197) -Codechange: replace int32 with CommandCost where appropriate. 17 years ago
rubidium 6cd88fd449 (svn r10154) -Fix [FS#870]: some vehicles were not drawn when having a high resolution and a high zoom-out level. Patch by B. N. SmatZ!. 17 years ago
rubidium 5644794af9 (svn r10153) -Fix [FS#869]: vehicles disappear when crossing certain tiles. Fix by B. N. SmatZ!. 17 years ago
peter1138 cb54a561ef (svn r10129) -Fix (r10111): Test for x == INVALID_COORD instead of v->tile == INVALID_TILE to determine if a vehicle should be removed from the has. 17 years ago
glx 3de8438314 (svn r10126) -Fix (r10111, FS#864): old_new_hash cache was not reset when the position hash were 17 years ago
peter1138 ce590b59f3 (svn r10111) -Codechange: Add new vehicle hash table for collision detection and finding vehicles on a tile. The hash area scanned is far smaller than the old hash table, which is now used for viewport updates only. This should give a significant performance improvement for games with many vehicles. (Based on work by 'B. N. SmatZ!' and 'madman2003') 17 years ago
maedhros c186f91cbd (svn r10097) -Feature: Add support for articulated road vehicles, or callbacks 11 and 17 for
road vehicles for those who prefer the technical explanation.
17 years ago
bjarni 160aa21f31 (svn r10077) -Fix: FS#845 Cloning Trains Longer Than 8 Units Causes Crash
The problem was that if adding units to the clone (wagon by wagon) failed, then cloning wouldn't notice it and it made two half trains
  Now it detects this case and it will make cloning fail. The string with the explanation for the failed move will be used in the error message so the user will know why it failed.
17 years ago
peter1138 f2e0912ce9 (svn r10062) -Codechange: Don't redraw all station tiles when cargo is added or removed if the station has no custom graphics. 17 years ago
rubidium 0fcda4e45c (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. 17 years ago
rubidium ddf249b2fe (svn r10049) -Codechange: get rid of the SLE_WRITEBYTE obfuscation. 17 years ago
peter1138 a0a43b4a7e (svn r10048) -Fix (r6455): Don't use override engine type for articulated wagon parts. 17 years ago
maedhros fb5072b824 (svn r10020) -Fix [FS#824]: GetNextVehicle() is invalid for anything that isn't a train. 17 years ago
maedhros fa548f1a6f (svn r10009) -Codechange: Add and use Vehicle::IsPrimaryVehicle to replace individual checks depending on the vehicle type. 17 years ago
maedhros d07b57f9aa (svn r9959) -Fix: Only call GetNextVehicle for trains. 17 years ago
peter1138 7273802f0c (svn r9956) -Codechange: Add tram livery schemes 17 years ago
maedhros 4ff33af406 (svn r9953) -Fix: Only check whether trains are multiheaded when cloning. 17 years ago
maedhros c7897d4422 (svn r9939) -Fix (r3139): EngineHasArticPart(v) is only valid for trains. 17 years ago
rubidium 21546a66f3 (svn r9917) -Codechange: prepare some more areas for more road types. 17 years ago
rubidium 821e58ac95 (svn r9914) -Codechange: prepare GTTS and the pathfinders to handle multiple road types on a single tile. 17 years ago
glx bba732921f (svn r9896) -Fix (r9874): when selling an entire train, decrease the number of vehicles in the group only once 17 years ago
peter1138 45d1c92030 (svn r9889) -Codechange: Use cargo's freight status for choosing livery scheme. 17 years ago
rubidium 86bb5cc2a6 (svn r9878) -Fix (9874): some vehicle count's were not properly updated on delete or autoreplace of vehicles. 17 years ago
rubidium 8f0f090c51 (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. 17 years ago
rubidium c17c5e972b (svn r9872) -Codechange: more type strictness for vehicle types 17 years ago
rubidium c8d05162c2 (svn r9869) -Codechange: replace some bytes with VehicleType, i.e. more type strictness. 17 years ago
truelight b605f68631 (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
17 years ago
rubidium 08be68e0b4 (svn r9841) -Codechange: add a little more type strictness to the vehicle types. 17 years ago
rubidium 07bdd6c3cc (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. 17 years ago
rubidium 5ae882a184 (svn r9831) -Codechange: more refactoring of the loading/unloading. 17 years ago
rubidium a84ca16dc4 (svn r9808) -Codechange: unify the Handle<VehicleType>Loading functions. 17 years ago
rubidium f47e81c900 (svn r9799) -Codechange: separate engine class and engine running cost class (mart3p). 17 years ago
rubidium 425923c8d2 (svn r9795) -Codechange: enumify the EngineClass. 17 years ago
rubidium 9a893ebe20 (svn r9794) -Codechange: refactor the question whether a vehicle can be loaded into LoadUnloadVehicle instead of duplicating it for each vehicle. 17 years ago
rubidium d52b515de8 (svn r9789) -Fix (r9770): vehicles didn't get unloaded when 'full load' was specified and the vehicle was already full when it entered. 17 years ago
rubidium bc1901a6e4 (svn r9784) -Codechange: remove unused variable. 17 years ago
glx 2b05a306e2 (svn r9773) -Fix r9772: MSVC warning 17 years ago
rubidium e11e91b02c (svn r9772) -Fix [r9770,FS#761]: under some circumstances loading/unloading didn't work (correctly). 17 years ago
rubidium cc9d811f53 (svn r9770) -Codechange: perform the payment of cargo when loading/unloading, but when arriving at the station. 17 years ago
rubidium 5e4c9ad875 (svn r9764) -Codechange: replace some lookup tables by functions. 17 years ago
rubidium dfe7c5cd66 (svn r9763) -Codechange/Fix (r9760): don't read the variables that are calculated automatically either. 17 years ago
rubidium 5a46c763f0 (svn r9760) -Codechange: remove the need for saving some vehicle variables. 17 years ago
rubidium df59f5cd15 (svn r9755) -Codechange: refactor some more of the begin loading stuff. 17 years ago
rubidium 0def47a3b0 (svn r9754) -Codechange: make classes for all vehicle types, so we can make nicer/better maintainable code, i.e. virtual methods instead of switches. 17 years ago
rubidium dba21ab802 (svn r9752) -Codechange: remove some duplication related to BeginLoading. 17 years ago
maedhros 8acc58b731 (svn r9742) -Fix (r9689) [FS#739]: Fix cloning with refit costs again, hopefully for good this time. 17 years ago
peter1138 d7d29cfc1e (svn r9714) -Fix (r8110): Remove invalid assertion triggered by overly long trains being reversed while loading. 17 years ago
peter1138 9861db8596 (svn r9702) -Codechange: Add livery support to newgrf vehicle var 43 17 years ago
rubidium 52daf7a2d3 (svn r9692) -Fix (r9683): don't try to remove vehicles from the queue of a non-existing station. 17 years ago
bjarni 404880feed (svn r9689) -Fix: Clone vehicles will no longer refit for free 17 years ago
maedhros 88af5b07d3 (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.
17 years ago
rubidium 1951817f3b (svn r9683) -Fix [FS#423]: improved loading does not use a huge amount of processing power anymore when having a lot of trains. 17 years ago
rubidium 2ce514284c (svn r9673) -Cleanup: remove spaces before tabs and replace non-indenting tabs with spaces. 17 years ago
rubidium 7577954ced (svn r9672) -Cleanup: lots of coding style fixes around operands. 17 years ago
peter1138 0d32783f87 (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. 17 years ago
belugas 0eaa72e324 (svn r9665) -Documentation: Doxygen corrections,errors, corrections of corrections... 17 years ago
maedhros 3d81de8d7e (svn r9609) -Codechange: Move some function prototypes out of functions.h and into landscape.h, and add a few where they didn't exist. 17 years ago
maedhros f925791a10 (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. 17 years ago
maedhros 0340291888 (svn r9562) -Fix: When cloning, pay for the refit costs as well. 17 years ago
belugas 45b0c8042f (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that... 17 years ago
peter1138 93fe91cc8c (svn r9388) -Codechange: variable scope and type, and standardify all CargoID loops. 18 years ago
peter1138 3d3d8d7c47 (svn r9303) -Codechange: Use cargo class when counting passengers in a road vehicle crash, and when loading aircraft. 18 years ago
peter1138 fa206387ad (svn r9302) -Codechange: Use cargo class to test for passengers when deciding on the livery scheme to use. 18 years ago
bjarni b6efe5482d (svn r9073) -Codechange: moved autoreplace to a file of it's own (now autoreplace has a cmd and a gui file) 18 years ago
rubidium 36cea84b11 (svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code). 18 years ago
rubidium 979ccd45ba (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {}; 18 years ago
rubidium 4169bfba06 (svn r9050) -Codechange: Foo(void) -> Foo() 18 years ago
richk cd7b71092b (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. :)
18 years ago
maedhros 2f557f7dc0 (svn r8945) -Codechange: Rename v->load_status to v->vehicle_flags so it can be used for more than just the gradual loading status. 18 years ago
tron 05c6e8f883 (svn r8897) -Fix
Change the signature of GetNewVehiclePos():
-void GetNewVehiclePos(const Vehicle *v, GetNewVehiclePosResult *gp);
+GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v);
18 years ago
tron 270e366772 (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.
18 years ago
peter1138 6b7a4ba448 (svn r8891) -Codechange: Remove remains of global cargo scheme. All cargo mapping is now dealt with only in NewGRF code, on load where possible. 18 years ago
peter1138 2306a02f75 (svn r8849) -Codechange: Replace hardcoded global/climate cargo mapping tables with dynamically generated data. Change associated code to use new functions. 18 years ago
tron 053e2ddda5 (svn r8841) -Fix
Remove {,u}intswap() and replace them by Swap()
18 years ago
bjarni 2841e946af (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
18 years ago
celestar d9f034bd87 (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. 18 years ago
rubidium a2999dadc9 (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p. 18 years ago
rubidium a374caf51d (svn r8730) -Codechange: more replacements of magic numbers by enums and removal of some (by now) redundant comments. 18 years ago
rubidium b5dade8098 (svn r8715) -Codechange/cleanup: replace magic numbers related to state of road vehicles with enums. Original patch by mart3p. 18 years ago
rubidium 0ba18a677c (svn r8701) -Codechange: replace magic numbers with enums for u.rail.track. 18 years ago
rubidium eb5648f382 (svn r8698) -Codechange: enumify the returns of VehicleEnterTile 18 years ago
bjarni d40886903d (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
18 years ago
bjarni f626458af7 (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
18 years ago
rubidium bec2c60245 (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. 18 years ago
maedhros 913558797b (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. 18 years ago
belugas e8af755d7f (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.
18 years ago
Darkvater 83ba97c755 (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 18 years ago
Darkvater fa0b625552 (svn r8429) -Codechange: Add a name for AircraftVehicleInfo subtype helicopter and remove some magic numbers related to the subtype. 18 years ago
Darkvater 2ff4492abc (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. 18 years ago
tron 7fffe8b3d4 (svn r8385) -Fix
-Regression (r8314): I only did half the necessary changes to move railtype from Engine to RailVehicleInfo. Now do the rest.
18 years ago
bjarni c4dd62914a (svn r8353) -Cleanup: added IsPlayerBuildableVehicleType() to autoreplace code (duplicated code removal) 18 years ago
bjarni 89bf1d627b (svn r8349) -Codechange: replaced CMD_REFIT_VEH() and similar defines with real static inline functions 18 years ago
tron 3d5acc1450 (svn r8314) -Fix
-Codechange: Move the railtype from EngineInfo to RailVehicleInfo, because having a railtype for non-rail vehicles isn't that useful
18 years ago
bjarni 8ca4a7d8d9 (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
18 years ago
bjarni 1995cdf00b (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
18 years ago
bjarni 24a8b16197 (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
18 years ago
peter1138 323898cb97 (svn r8211) -Codechange: (NewGRF) Implement callback 2D, explicit vehicle colour map
selection.
18 years ago
rubidium 39ca1ef7ae (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. 18 years ago
bjarni ee424b3618 (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
18 years ago