Commit Graph

286 Commits (03d3d5677f8f6f260c6e6e2ecb4aad988c4245c8)

Author SHA1 Message Date
bjarni 16fe2503d3 (svn r6464) -Fix r6393: killed a warning when compiling without asserts
added an error popup in the game if autoreplace fails to refit
   Since it's only triggered by conditions bugs can trigger, it works kind of like a non-fatal assert in builds without asserts
18 years ago
peter1138 53e90c0628 (svn r6456) - Replace single colour scheme for passenger wagons with separate schemes for each of steam, diesel or electric engines. Savegames from the previous revision will not load. 18 years ago
peter1138 e47dd91c8b (svn r6455) - Feature: Add 2cc (two company colours) livery schemes. This replaces the original colour selection window and bumps the saveload version. Liveries are supported for all vehicles, not just those with 2cc support. Thanks to lakie for GUI inspiration. 18 years ago
bjarni c545edf46f (svn r6424) -Codechange: [autoreplace] removed a loop though all vehicles from each time the window is redrawn
To do this, the player struct contains an array, that contains the count of each engine type that the player owns
   Those arrays are updated each time a vehicle is build or deleted and is calculated on load (it's not saved)
   It's possible to access the arrays outside of the autoreplace GUI, so feel free to read from them in other patches as well
18 years ago
Darkvater 544ff2aaf9 (svn r6407) -Fix: Check return values of DoCommand() with CmdFailed and that of DoCommandP
with a boolean type.
18 years ago
bjarni 75d8a724fa (svn r6394) -Fix r6393: removed a warning originally removed in r6376 accidentally readded in r6393 18 years ago
bjarni 965693bdce (svn r6393) -Fix: [autoreplace] now refit costs are added to the estimated costs (could spend more than allowed when estimate and actual cost were not the same)
-Fix: [autoreplace] fixed a very rare failure when building an engine could cost more than the player could pay before selling the old one
   this happened when the replacing the front cost so much that the the rear end didn't have enough money to build as expected
   now the estimate keeps track of the price for the wagons/engines in front of the unit it's currently looking at
-Codechange: [autoreplace] added function to learn if and what cargo type to refit to. Needed to allow the estimation to tell refit costs
18 years ago
glx 9965957986 (svn r6386) -Fix(r6376): removed a warning 18 years ago
rubidium 21ac20aeca (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
-Cleanup: whitespace alignment of a few tables.
18 years ago
bjarni 21195804c3 (svn r6376) -Codechange: [vehicle refit] moved all refit cost calculations into GetRefitCost()
Now it's possible to tell refit costs for an EngineID without actually having build a vehicle
18 years ago
tron d5e5a78cf4 (svn r6353) -Codechange: Make DestinationID a typedef of uin16, which is as large as any type of destinataion (StationID, DepotID, WaypointID) it can hold
DestinationID being a union of these types is just hassle without benefit and cannot be handled correctly everywhere because of local lack of information
18 years ago
bjarni 04745c2d66 (svn r6300) -Fix: FS#321 autoreplace / wagon removal
turned out to be a failure to run the wagon remoral code if the player didn't have enough money to do the replace after the replace took place
  the cost animation failed to show in this condition as well
  Now the test is not run anymore after the replace took place
18 years ago
bjarni 71da9f3abc (svn r6291) -Feature: Vehicle lists from the station window now also got the goto depot button
-Codechange: unified the code for mass goto depot to avoid duplicated code
-Fix: Vehicles already on the way to depots will not be cancelled by mass goto depot (made it really hard to send all vehicles at once)
18 years ago
bjarni ece5584d00 (svn r6284) -Code Cleanup r6282: cleaned up the code a bit 18 years ago
bjarni 7d6692d41d (svn r6282) -Codechange: made a function to create the vehicle list for vehicle list windows
this list is also used by mass goto depot to ensure that they use the same vehicles
	right now only the list of all vehicles use this for goto depot, but eventually all the types will use this
18 years ago
Darkvater 6919e7f8ea (svn r6280) -Codechange: Use the same naming for trains as for other vehicles:
CMD_SEND_TRAIN_TO_DEPOT instead of CMD_TRAIN_GOTO_DEPOT
18 years ago
bjarni e2f8ef4f72 (svn r6249) -Fix: fixed assert when pressing goto depot in an empty list (forgot to disable the button in this condition)
-Code cleanup r6246: simplified SendAllVehiclesToDepot() and moved an { in PlayerVehWndProc()
18 years ago
bjarni 1d011b57d2 (svn r6246) -Feature: added the many times requested "send all vehicle to depot" button
it's located in the vehicle list screen and does the same as in the shared orders window (send all vehicles in list to a depot)
	it will still not inform the player if a vehicle failed to find a depot, so don't take for granted that all of them go
18 years ago
bjarni 386468dc72 (svn r6229) -Feature: Shared order lists now got a "goto depot" button
this will try to send all vehicles in the list to depots/hangars
	currently if one fails to find a depot, it will not tell the player
18 years ago
rubidium 86dc219b4b (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc. 18 years ago
truelight 7f84bcc917 (svn r6157) -Codechange: DeleteVehicle removes a vehicle from the pool
-Codechange: DestroyVehicle is called by DeleteVehicle to remove all things where a vehicle depends on.
  Last 2 changes to prepare for new pool system. Not pretty now, will be soon.
18 years ago
truelight 65f5ec13f6 (svn r6142) -Codechange: added WaypointID (sorry DV, couldn't splits it anymore)
-Codechange: introduced DestinationID, which is in fact an union of several types
  Used in Order struct, so no longer StationID is abused for all targets.
  Hangars are a big exception, as they use a station-id with GOTO_DEPOT (go figure)
18 years ago
truelight 213c71be3f (svn r6053) -Codechange: renamed all IsXXXIndex to IsValidXXXID
-Codechange: IsValidXXXID now also checks if XXX is really valid, not if the number is within range
  Both changes again in preperation of the new mem-pool system, which requires this.
  IsValidXXXID is not a bit less pretty, but that will be cleaned up after the new mem-pool system
18 years ago
truelight 505566da5c (svn r6047) -Codechange: FOR_ALL now _only_ loops valid items, and skips invalid ones
-Codechange: use IsValidXXX where ever possible
  Note: both changes to prepare for new pool system, which needs those changes.
  For every pool there are 2 ugly lines, which will be removed when done
  implementing new pool system.
  Based on FS#13 by blathijs, partly implemented.
18 years ago
rubidium 908d3bcfe6 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct. 18 years ago
rubidium 6fb092aa7a (svn r5999) -Feature: change the original date format to a 32 bits format based at the year 0.
The game date subsystem now allows someone to start in the year 0 and continue
up to the year 5 000 000. However, you currently cannot build anything before 
1920 as there is no newgrf support for dates before 1920 or after 2090 yet.
18 years ago
bjarni fda8bf2a22 (svn r5917) -Fix: [clone vehicles] FS#275 Bugfix: Cloned Road Vehicles Are Not Refitted To Correct Cargo (Mart3p) 18 years ago
Darkvater fe811fd8cd (svn r5898) -Fix [FS#249]: Bugfix: Goto Depot not always working for road vehicles. (mart3p) 18 years ago
bjarni d23bacb016 (svn r5891) -Code cleanup: cleaned up the code added in revision 5888 18 years ago
bjarni 1f2311413d (svn r5888) -Fix: [autoreplace] if vehicles breakdowns and service are turned off, the vehicles failed to enter any depots
now they will quickly go to a depot if set to be replaced
	the tradeoff is that a vehicle set to be replaced and without a depot in the orders will forget about the orders and head for a depot. If the replace fails (lack of money), it will exit and try to head for the depot again
	also all vehicles of that type will rush to the depots at once, risking causing traffic jams. This is because there is no way to even it out like normal depot visits offers
	Tip: add a depot to the orders of all vehicles, set it to service only and it will always be skipped unless the vehicle is set to be replaced. This should help on the jam issue and if the replace fails, the vehicle will go though a whole round of the orders and make more money before trying again
18 years ago
rubidium 9fc837ad85 (svn r5887) -Cleanup: move date related functions, defines and variables to date.[ch]
-Cleanup: fix whitespace related coding style issues in date.[ch]
-Cleanup: make original comments doxygen compatible and remove/change outdated comments
18 years ago
tron 9900f3d871 (svn r5614) Move a type declaration to its only user 18 years ago
tron 677ecc624c (svn r5613) Rename VS_DISASTER to VS_SHADOW, because this is what this flag actually means 18 years ago
tron 9b0875a9e5 (svn r5612) Restructure some code which uses the vehicle position hash to make it a bit clearer what's going on 18 years ago
tron 773dce9a69 (svn r5599) GetPrevVehicleInChain() may never fail to find a valid vehicle. Reflect this in the code 18 years ago
KUDr e3f40ce857 (svn r5483) -Fix: [YAPF] desync - for MP games invalidate YAPF cache on every tick to keep it exactly the same on server and clients (it doesn't fix the real source of the problem, but should solve it). Thanks TrueLight for hunting this bug. 18 years ago
bjarni 7e30c450f6 (svn r5468) -Fix: fixed declaration after statement added in 5465 (I wonder why the makefile failed to warn about this)
also removed a few lines of debug code
18 years ago
bjarni 8e8d83f12e (svn r5465) -Feature: [autoreplace] replacing from a train engine without cargo capacity to one with cargo capacity will now make autoreplace refit the engine to carry the cargo type from the last wagon in the train
if the train is carrying the type of cargo, that is default for the engine, it will not be refitted
	if the last wagon do not carry cargo, the refit will be to the type of the last wagon, that do carry cargo
18 years ago
bjarni 979bdc55f1 (svn r5428) -Fix: [vehicles] sovled crash when trying to build a vehicle type, that is set to max 0 (spotted by roboman)
somebody might add a better string than "too many vehicles in game" since none are allowed, but at least it will not crash anymore
18 years ago
tron 772fbda3e3 (svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular 18 years ago
peter1138 67ce8b9ea0 (svn r5191) - NewGRF: add cargo refit support for road vehicles 18 years ago
peter1138 8c9de5e593 (svn r5146) - NewGRF: Support selection of aircraft default cargo type by checking its refit mask. If aircraft can be refitted to passengers, no change happens, else the first refittable type is chosen. Also use refit capacity to determine the default capacity. 18 years ago
tron ce9639c6bc (svn r5120) Add IsShipInDepot{Stopped,}() and remove some redundant checks 18 years ago
tron d26e40ca7e (svn r5118) Add IsRoadVehInDepot{Stopped,}() 18 years ago
tron cfdbb53a82 (svn r5116) Move the overly generic GetDepotDirection() from a header to its only consumer 18 years ago
tron 3cb526d0d9 (svn r5101) Add a function to convert an axis and a flag for north/south into a DiagDirection. Use it for bridge ramps and ship depots 18 years ago
tron 9ee944cabb (svn r5094) Remove _new_{aircraft,roadveh,ship,train,wagon}_id. _new_vehicle_id is enough. 18 years ago
bjarni 337e896661 (svn r4967) -Fix: [clone vehicles] a cloned train engine heads the same way as the original (pointed out by bobingabout)
[autoreplace] the same applies to autoreplaced trains if the engine is a single unit (not dualheaded or articulated)
18 years ago
tron 2b17d16ce2 (svn r4937) Reduce the use of _error_message a bit 18 years ago
bjarni cbcf207e5e (svn r4829) -Codechage: [clone vehilces] only check for a free unitnumber for the first engine in the test run as well as execute run (to improve speed. The result should be unchanged) 18 years ago