Commit Graph

265 Commits

Author SHA1 Message Date
truelight db8dfcd6e9 (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)
2006-08-26 16:34:03 +00:00
truelight b23f719ab9 (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
2006-08-22 18:15:17 +00:00
truelight 0461d89612 (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.
2006-08-22 15:33:35 +00:00
rubidium 480af9c917 (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. 2006-08-22 14:38:37 +00:00
rubidium 28a0843707 (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.
2006-08-20 18:40:57 +00:00
bjarni 08fd0bed1f (svn r5917) -Fix: [clone vehicles] FS#275 Bugfix: Cloned Road Vehicles Are Not Refitted To Correct Cargo (Mart3p) 2006-08-15 15:27:30 +00:00
Darkvater a35511dc9b (svn r5898) -Fix [FS#249]: Bugfix: Goto Depot not always working for road vehicles. (mart3p) 2006-08-14 22:34:43 +00:00
bjarni 4b82897e25 (svn r5891) -Code cleanup: cleaned up the code added in revision 5888 2006-08-14 16:18:41 +00:00
bjarni 37f94c7557 (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
2006-08-14 15:03:01 +00:00
rubidium 243872b4fd (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
2006-08-14 14:21:15 +00:00
tron 0973dc78cd (svn r5614) Move a type declaration to its only user 2006-07-26 08:41:14 +00:00
tron 16bf3e35cd (svn r5613) Rename VS_DISASTER to VS_SHADOW, because this is what this flag actually means 2006-07-26 08:32:20 +00:00
tron 3aa408ee02 (svn r5612) Restructure some code which uses the vehicle position hash to make it a bit clearer what's going on 2006-07-26 08:27:05 +00:00
tron c4ed8e9ec4 (svn r5599) GetPrevVehicleInChain() may never fail to find a valid vehicle. Reflect this in the code 2006-07-23 17:17:43 +00:00
KUDr b14c5fdf74 (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. 2006-07-11 19:04:50 +00:00
bjarni 446804c19d (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
2006-07-07 17:16:52 +00:00
bjarni 356954ca26 (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
2006-07-07 07:19:38 +00:00
bjarni 0df769f3ed (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
2006-06-29 09:05:30 +00:00
tron 2b27073156 (svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular 2006-06-27 21:25:53 +00:00
peter1138 e679cfe802 (svn r5191) - NewGRF: add cargo refit support for road vehicles 2006-06-09 07:45:26 +00:00
peter1138 d286235a6a (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. 2006-06-07 07:20:28 +00:00
tron cb13a1e43d (svn r5120) Add IsShipInDepot{Stopped,}() and remove some redundant checks 2006-06-05 11:28:00 +00:00
tron eeeb8172e8 (svn r5118) Add IsRoadVehInDepot{Stopped,}() 2006-06-05 10:23:18 +00:00
tron 4f5c84e720 (svn r5116) Move the overly generic GetDepotDirection() from a header to its only consumer 2006-06-05 08:34:39 +00:00
tron fa74002356 (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 2006-06-04 16:04:15 +00:00
tron a0caafeb50 (svn r5094) Remove _new_{aircraft,roadveh,ship,train,wagon}_id. _new_vehicle_id is enough. 2006-06-04 09:28:33 +00:00
bjarni 4557832c9c (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)
2006-05-23 21:49:18 +00:00
tron 1706164ff7 (svn r4937) Reduce the use of _error_message a bit 2006-05-21 11:34:08 +00:00
bjarni 13d9690f3a (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) 2006-05-11 14:24:33 +00:00
bjarni 2e05a16959 (svn r4826) -Fix: [autoreplace] fixed possible problem when autoreplacing and was number of vehicles (of a type, not total) was reached
now the new vehicle gets the same number as the old one, completely removing the problem where we could run out of numbers
	since we don't have to find free numbers for the new vehicles, autoreplace should be somewhat faster, specially in late games
	NOTE: in CmdBuildRailVehicle(), bit 0 and 1 in p2 have been switched to make the meaning of bit 0 consistent with the other build commands. CmdCloneVehicle() is modified to follow this as well
2006-05-11 13:31:14 +00:00
bjarni 06156142d4 (svn r4825) - Fix [clone FS#159]: Game crashes when cloning reaches train-limit. 2006-05-11 12:42:24 +00:00
tron c9defc0fea (svn r4790) Remove slope magic from EnsureNoVehicleZ() and rename it to EnsureNoVehicleOnGround() to make more clear what it does 2006-05-09 09:56:09 +00:00
bjarni 246e53d206 (svn r4599) -Fix: [Cloning, autoreplace] FS#141 clone service-interval
now cloned vehicles get the same service interval as the original vehicle
	I applied this to autoreplace as well even though it's not mentioned in the bug report (autorenew should not alter service interval)
2006-04-27 23:11:43 +00:00
tron 18ad0ae50e (svn r4572) Remove vehicle_leave_tile_proc
There's exactly one implemented function (unbarring a level crossing) and one place where it can be triggered (a train leaves a level crossing)
It's a bit overkill, so just handle this one case where it can happen
2006-04-25 07:32:33 +00:00
tron c1dc517dab (svn r4554) Replace magic numbers by TILE_{HEIGHT,SIZE} 2006-04-23 19:35:36 +00:00
tron 0347fb2ab6 (svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums 2006-04-23 13:48:16 +00:00
peter1138 ae7ec5cd0d (svn r4471) - Pools: Add a facility for calling a custom function during pool block clean up. 2006-04-18 18:48:50 +00:00
tron 81e6d68f95 (svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
Remove DoCommandByTile(), because now it does the same as DoCommand()
2006-04-10 07:15:58 +00:00
celestar 6926bd55fd (svn r4341) -Fix (FS#101) When a player got bankrupt, slots were not cleared, because vehicles got deleted directly by DeleteVehicle 2006-04-09 18:35:24 +00:00
celestar 5931b34aff (svn r4259) -[multistop] Fix/Feature/Codechange:
1) Improved the road vehicle allocation (aka slotting) for multistop. Stops can now accept unlimited, er... 256, vehicles.
2) Removed the "wait for stop" feature, because it did not work in practise.
3) Slotting now ignores unreachable stations. Uses NPF at the moment because the old pathfinder cannot do it (yet)
4) Now matter how many vehicles approach a station, they will always be distributed evenly over existing stops.
5) Hopefully the last fundamental change to multistop
2006-04-03 14:25:32 +00:00
peter1138 9d5e052bbc (svn r4256) - Codechange: Replace lone map access in vehicle.c with its map accessor. 2006-04-03 12:41:31 +00:00
celestar cc87f682b9 (svn r4249) -Codechange: Replace more occurences of 16 by TILE_SIZE and of 8 by TILE_HEIGHT. Reverted one change from the previous commit because it was faulty 2006-04-03 09:07:21 +00:00
celestar 3aa1e38be6 (svn r4246) -Codechange. Replaced about 100 occurences of '16' by TILE_SIZE 2006-04-03 05:32:11 +00:00
bjarni 7c64aa4142 (svn r4228) -Fix: [autoreplace] allow replacement of wagons even when the engine fails to be replaced 2006-04-01 15:11:30 +00:00
peter1138 96288ee39a (svn r4227) - Fix: Wagon replace nows checks if the cargo types are the same before seeing if it can refit. 2006-04-01 14:53:38 +00:00
celestar 446493149c (svn r4215) -Codechange: Renamed *RoadStation* functions to *RoadStop* and moved them to station_map.h to keep consistency 2006-03-31 19:10:54 +00:00
peter1138 cd0a67dc65 (svn r4201) - Codechange: Do for _engine_info[] what we do for _*_vehicle_info[]; create and use a function to retrieve data, and ensure constness. 2006-03-31 12:59:43 +00:00
bjarni 0151ab0379 (svn r4159) added missing comments about refitting in CmdCloneVehicle 2006-03-29 20:57:17 +00:00
bjarni 0c64cecc66 (svn r4158) -Fix: [autoreplace] cost for refitting the new vehicle is now added to the cost animation. The player always paid for it, but it was not displayed until now 2006-03-29 20:41:15 +00:00
celestar a7d8ad0004 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas. 2006-03-29 16:30:26 +00:00