|
rubidium
|
r5469:9c38e5ce3f50
|
18 years ago
|
|
|
|
Darkvater
|
r5380:f5fecf6b34ff
|
18 years ago
|
|
(svn r7565) -Codechange: Rework DEBUG functionality. Look for appropiate debugging levels to use in debug.h. grfmsg() is now used as a specific debug-function for grf.
|
|
Darkvater
|
r5357:e363308bd9c2
|
18 years ago
|
|
(svn r7535) -Fix (r7326): Always unload cargo if the station accepts it, and always load cargo if it's available with full load any (Maedhros)
|
|
Darkvater
|
r5352:64720e7993a1
|
18 years ago
|
|
(svn r7523) -Feature: Add the possibility to change the newgrf configuration of a running game. This is only possible in SP (or in the intro menu). During game play you will get a confirmation window when applying the changes as some actions can crash OpenTTD and/or make your current game unplayable.
|
|
rubidium
|
r5295:4ec3416d1cd4
|
18 years ago
|
|
|
|
bjarni
|
r5256:f114a289aae7
|
18 years ago
|
|
(svn r7386) -Codechange r7385: moved deletion of the vehicle highlight from DeleteVehicle to the sell commands as they are not called as often Also added a return to the window loop prevent looking at the rest of the windows once the right depot window is found
|
|
bjarni
|
r5255:25f078d06bc1
|
18 years ago
|
|
(svn r7385) -Fix: FS #418 Deleting Train in depot with autoreplace failes This turned out to be due to continue to drag the old vehicle, that autoreplace sold This could also be triggered if more than one player used the same company Now deleting a vehicle will remove all depot highlights of that vehicle
|
|
matthijs
|
r5247:1abbd3b3cd80
|
18 years ago
|
|
|
|
matthijs
|
r5216:bdd3aa57475e
|
18 years ago
|
|
(svn r7331) - Codechange: Rename all memory pool macro's and types to "old pool", so the new pool implementation can be committed alongside it. - Codechange: Rename pool.[ch] to oldpool.[ch].
|
|
peter1138
|
r5211:4adf6d7ce809
|
18 years ago
|
|
|
|
peter1138
|
r5062:538825323a2d
|
18 years ago
|
|
|
|
tron
|
r4972:d62dbc1ddead
|
18 years ago
|
|
|
|
peter1138
|
r4925:a1a3a58b08e3
|
18 years ago
|
|
|
|
Darkvater
|
r4912:d420151de4c6
|
18 years ago
|
|
(svn r6884) -Codechange: Add strict bounds checking in string formatting system. The last parameter should point to the end of the buffer (eg lastof(buf)) Courtesy of Tron.
|
|
peter1138
|
r4862:d628b8a0219f
|
18 years ago
|
|
|
|
bjarni
|
r4784:57e2f2e42863
|
18 years ago
|
|
|
|
bjarni
|
r4783:73296ad1eafd
|
18 years ago
|
|
(svn r6697) -Fix: [order refit] if an order refit fails, the vehicle is now stopped and the player gets a message (like vehicle stopped in depot) This should prevent a vehicle from failing to be refitted and then show up and block a station with full load. In such a case, it's better to stop in a depot (that will not stop any other vehicles) and notify the owner
|
|
bjarni
|
r4782:4c2c57e89a48
|
18 years ago
|
|
(svn r6696) -Codechange: changed all comparision for refit cargo in orders against CT_NO_REFIT to checks for valid cargo IDs This should prevent any bugs made by mixing up CT_NO_REFIT and CT_INVALID
|
|
bjarni
|
r4762:8a6762a1172b
|
18 years ago
|
|
|
|
bjarni
|
r4741:5f61bbacfdf6
|
18 years ago
|
|
|
|
bjarni
|
r4739:596230f43fa6
|
18 years ago
|
|
(svn r6651) -Coding feature: added the windowevent WE_INVALIDATE_DATA This gives the ability to invalidate some window data and recalculate as needed instead of doing it for each WE_PAINT
This event is called right away when using InvalidateWindowData(), so it may be a good idea to set a bool or similar in the window or similar and then act on that bool in WE_PAINT instead of doing a lot of stuff in WE_INVALIDATE_DATA as it might be called more than once before WE_PAINT is called
InvalidateWindowData() will not automatically repaint the window, so if you want to repaint it as well, you need to mark it dirty as well.
Made the depot windows use WE_INVALIDATE_DATA to set when to generate the engine and wagon lists instead of at each redraw It makes no sense to regenerate the list when say using the scrollbar if we know that no vehicle have entered or left the list
NOTE: currently there is a piece of code to generate the list when it's not needed and compare it to the stored list and assert if they mismatch This check is somewhat slow and kills the whole idea of WE_INVALIDATE_DATA, so it's a short lived one to verify that InvalidateWindowData() is used everywhere where it's needed
|
|
bjarni
|
r4736:f53f31179cbd
|
18 years ago
|
|
|
|
bjarni
|
r4734:5b69ddbf3f28
|
18 years ago
|
|
(svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code This moved a few of the strings and sprites a few pixels. Hopefully this will work out ok.
|
|
bjarni
|
r4728:8b07722e006b
|
18 years ago
|
|
(svn r6640) -Fix: [autoreplace] autoreplace can now use the money for selling the old vehicle to build the new one Say we got 40k for selling the old one and the new one costs 60k, then the player only needs 20k to replace
The new engine is still built before selling the old one for various reasons, but now the player gets a loan of the sell value, which is always repaid when replace fails or the old engine is sold. The player will never notice this loan.
|
|
bjarni
|
r4725:3a289e38fda7
|
18 years ago
|
|
(svn r6637) -Codechange: merged all (vehicle type)EnterDepot into VehicleEnterDepot() This revealed duplicated code like aircraft lists got invalidated twice Moved invalidation of the vehicle detail window to VehicleServiceInDepot() as it should always be updated when serviced
|
|
bjarni
|
r4712:ace1fd623579
|
18 years ago
|
|
(svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders) Example: make a train transport iron ore from A to B, then it visits a depot and refits to steel It then transport steel back to A or near A if there is a factory and then it visits another depot to refit to iron ore again
This is controlled in the orders. If a goto depot order is lightlighted, then "Unload" changes to "Refit" Control click "Refit" removes the refit part of the order (as the tooltip says) The player will still pay the normal refit costs
Known issues: If a vehicle is not in a depot, then the refit window will fail to tell refitted cargo capacity Refit costs in the refit window can sometimes print 0 when it should not because the refit calculation is unaware that the vehicle will be refitted in between
Warning: autoreplace got a protection against replacing something so you get a new cargo type, but it can fail here. In the iron ore/steel example, it can see that the vehicle carries iron ore and the new one can be refitted to iron ore, then it will replace. It will not check to see that it's valid for steel as well. This is something to look into in the future
|
|
peter1138
|
r4695:dfd8be1a9fcf
|
18 years ago
|
|
|
|
glx
|
r4685:e378929a1b14
|
18 years ago
|
|
|
|
bjarni
|
r4683:84aa9d13abeb
|
18 years ago
|
|
|
|
bjarni
|
r4681:f719e26018b5
|
18 years ago
|
|
(svn r6586) -Feature: [depot window] added a vehicle list window with all vehicles having a certain depot in their orders It got one known issue though. The top bar got a plural issue so expect to see stuff like "1 trains" until we figure out why it behaves this way Added the button to the depot windows. Made the autoreplace button bigger while I was moving some widgets anyway Made road vehicle depot windows start with one more row to make room for the buttons
|
|
bjarni
|
r4678:0d1b544628db
|
18 years ago
|
|
(svn r6582) -Codechange: changed GenerateVehicleSortList() to reuse the same allocation over and over if possible (like BuildDepotVehicleList() ) This will prevent some reallocations when sorting vehicle list windows It also prevents moving the whole array into a new one each time the list is generated/updated (it used to make the list in one array and then move it into another one each time) Also ensured that neither GenerateVehicleSortList() or BuildDepotVehicleList() will never allocate lists longer than the total number of vehicles in the game
|
|
bjarni
|
r4676:88d575eca060
|
18 years ago
|
|
(svn r6580) -Fix r6552: [depot window] fixed issue where vehicles sometimes failed to restart after being replaced Also fixed an issue where cost animation could fail to show (trigger events appeared to be linked for those two issues)
|
|
bjarni
|
r4675:38f1dc13d33a
|
18 years ago
|
|
(svn r6579) -Fix r6552: [depot window] solved a condition where pressing autoreplace in a depot window could result in asserts It still got an issue where it fails to restart moving vehicles after they are replaced though. The cause of this will hopefully be found shortly
|
|
bjarni
|
r4673:42072dcef5b8
|
18 years ago
|
|
|
|
bjarni
|
r4662:d52885a4183b
|
18 years ago
|
|
(svn r6552) -Feature: [depot window] added a "autoreplace all vehicles in depot" button Like the "sell all" button, this one lacks a sprite as well. We will hopefully get one shortly
|
|
bjarni
|
r4659:eac0d373b66a
|
18 years ago
|
|
(svn r6542) -Feature: [depot window] added a "sell all vehicles in depot" button It's right below the sell button (sell whole chain button for trains) It's still missing a sprite. That one will be added as soon as anybody draws something we can use To make room for this button, all depots except train depots now opens with an additional row and can't be resized shorter than that
|
|
peter1138
|
r4656:515f0929a2ed
|
18 years ago
|
|
|
|
bjarni
|
r4648:90818f8d70ac
|
18 years ago
|
|
(svn r6524) -Code cleanup r6515: cleaned up the command to start/stop all vehicles in a depot. IsWholeTrainInDepot() is removed as CheckTrainInDepot() could be used instead Cleaned up the check to see if a vehicle is valid for start/stop
|
|
bjarni
|
r4640:3c3015b68f36
|
18 years ago
|
|
|
|
bjarni
|
r4635:6518f3ca4e6d
|
18 years ago
|
|
(svn r6503) -Codechange: added a function to tell what vehicles a depot contains This will ensure that you can always get the same list when checking for vehicles in a depot (no need to duplicate code for each place, that needs such a list) Since the vehicles are only looped once for each redraw, drawing speed is around twice as fast (measured to be 114%-121% faster depending on the number of vehicles in the game)
|
|
peter1138
|
r4616:6c3e63bd2e31
|
18 years ago
|
|
(svn r6474) - Add a patch option to control display of liveries, allowing none, your own, or all companies.
|
|
bjarni
|
r4613:851ac723e3df
|
18 years ago
|
|
(svn r6468) -Codechange r6464: now use error() when failing refit in autoreplace to ensure that such a failure will not break a game We should only reach this error() if there is a bug, that would otherwise make the vehicles carry a different type of cargo without telling the user This also kills the warning added in r6464 (oops)
|
|
bjarni
|
r4611:a78206fe2bcb
|
18 years ago
|
|
(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
|
|
peter1138
|
r4604:56d029090928
|
18 years ago
|
|
|
|
peter1138
|
r4603:3b159d0db197
|
18 years ago
|
|
|
|
bjarni
|
r4574:26f71b3f860b
|
18 years ago
|
|
(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
|
|
Darkvater
|
r4560:a5208774f99e
|
18 years ago
|
|
(svn r6407) -Fix: Check return values of DoCommand() with CmdFailed and that of DoCommandP with a boolean type.
|
|
bjarni
|
r4555:00e0118fa0b3
|
18 years ago
|
|
|
|
bjarni
|
r4554:db3dfbff780e
|
18 years ago
|
|
(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
|
|
glx
|
r4551:7c793ca82f4a
|
18 years ago
|
|
|
|
rubidium
|
r4549:76b9213799ac
|
18 years ago
|
|
(svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform. -Cleanup: whitespace alignment of a few tables.
|
|
bjarni
|
r4544:bbf9de0440c4
|
18 years ago
|
|
(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
|
|
tron
|
r4527:4b01e6756ce8
|
18 years ago
|
|
(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
|
|
bjarni
|
r4515:d37ca4d21a4e
|
18 years ago
|
|
(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
|
|
bjarni
|
r4506:98668beebd0e
|
18 years ago
|
|
(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)
|
|
bjarni
|
r4499:6dc7a6f1918c
|
18 years ago
|
|
|
|
bjarni
|
r4497:830791b61e3b
|
18 years ago
|
|
(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
|
|
Darkvater
|
r4495:4147c9c858d4
|
18 years ago
|
|
(svn r6280) -Codechange: Use the same naming for trains as for other vehicles: CMD_SEND_TRAIN_TO_DEPOT instead of CMD_TRAIN_GOTO_DEPOT
|
|
bjarni
|
r4465:dcf3b6c3c7d9
|
18 years ago
|
|
(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()
|
|
bjarni
|
r4463:83cb78b50982
|
18 years ago
|
|
(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
|
|
bjarni
|
r4451:73bac51a088c
|
18 years ago
|
|
(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
|
|
rubidium
|
r4434:c817458d470e
|
18 years ago
|
|
|
|
truelight
|
r4404:8b3cd6a4cdd5
|
18 years ago
|
|
(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.
|
|
truelight
|
r4389:7f4a6b884ac1
|
18 years ago
|
|
(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)
|
|
truelight
|
r4352:460a517b040f
|
18 years ago
|
|
(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
|
|
truelight
|
r4346:fa4ac6b6f852
|
18 years ago
|
|
(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.
|
|
rubidium
|
r4344:bff007ae1fd1
|
18 years ago
|
|
|
|
rubidium
|
r4326:7102aa7f4fb2
|
18 years ago
|
|
(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.
|
|
bjarni
|
r4287:2db5a0148745
|
18 years ago
|
|
|
|
Darkvater
|
r4270:99ea6086ada2
|
18 years ago
|
|
|
|
bjarni
|
r4263:1d030f49fd3e
|
18 years ago
|
|
|
|
bjarni
|
r4262:a5c311b59d95
|
18 years ago
|
|
(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
|
|
rubidium
|
r4261:8c2d0c75e37a
|
18 years ago
|
|
(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
|
|
tron
|
r4176:b2da845ac3ba
|
18 years ago
|
|
|
|
tron
|
r4175:d351c4462abf
|
18 years ago
|
|
|
|
tron
|
r4174:6529eee2aeda
|
18 years ago
|
|
|
|
tron
|
r4165:1403ae574376
|
18 years ago
|
|
|
|
KUDr
|
r4130:f81353ba65a4
|
18 years ago
|
|
|
|
bjarni
|
r4124:5a4af5174e79
|
18 years ago
|
|
(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
|
|
bjarni
|
r4121:cd9d226a235c
|
18 years ago
|
|
(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
|
|
bjarni
|
r4096:b353f8f7cec3
|
18 years ago
|
|
(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
|
|
tron
|
r4077:259c4c4aacad
|
18 years ago
|
|
|
|
peter1138
|
r3990:43bbedf6ead4
|
18 years ago
|
|
|
|
peter1138
|
r3973:2fd8355b77c7
|
18 years ago
|
|
|
|
tron
|
r3961:9417a3ee0930
|
18 years ago
|
|
|
|
tron
|
r3959:cd4598f2b792
|
18 years ago
|
|
|
|
tron
|
r3957:3b10ba0b14a1
|
18 years ago
|
|
|
|
tron
|
r3953:57cc3965106e
|
18 years ago
|
|
|
|
tron
|
r3948:4c986a48e294
|
18 years ago
|
|
|
|
bjarni
|
r3896:24d292aee7e0
|
18 years ago
|
|
(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)
|
|
tron
|
r3881:d1abaaddd42e
|
18 years ago
|
|
|
|
bjarni
|
r3819:739b765043bf
|
18 years ago
|
|
|
|
bjarni
|
r3816:1e2588e55d0e
|
18 years ago
|
|
(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
|
|
bjarni
|
r3815:26ed3187c908
|
18 years ago
|
|
|
|
tron
|
r3794:9d3fc41aae37
|
18 years ago
|
|
|
|
bjarni
|
r3679:a309327842da
|
18 years ago
|
|
(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)
|
|
tron
|
r3657:6dbb06e83a6d
|
18 years ago
|
|
(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
|
|
tron
|
r3645:de3cfb719308
|
18 years ago
|
|
|
|
tron
|
r3636:a8e0c73aca96
|
18 years ago
|
|
|
|
peter1138
|
r3585:4dae9cd69c90
|
19 years ago
|
|
|