Commit Graph

334 Commits

Author SHA1 Message Date
rubidium 79a7bf75a0 (svn r10279) [0.5] -Backport from trunk (r10139, r10153, r10154, r10155, r10165, r10187):
- Fix: Do not make a 270 degree turn on the international airport when a 90 degree turn is enough (r10187)
- Fix: Crash when trying to get the aircraft movement state of an aircraft going to a just deleted airport [FS#874] (r10165)
- Fix: Airports did not flood when there are aircraft on the airport [FS#601] (r10155)
- Fix: Some vehicles were not drawn when having a high resolution and a high zoom-out level [FS#870] (r10154)
- Fix: Vehicles disappear when crossing certain tiles [FS#869] (r10153)
- Fix: OpenTTD assumes that the resolution is at least 1 by 1, so force the resolution to be always at least 1 by 1 (r10139)
2007-06-22 20:08:37 +00:00
rubidium aa6a621f0a (svn r10275) [0.5] -Backport from trunk (r10048, r10068, r10075, r10082, r10085, r10087):
- Fix: "Deactivate Electrified Railways" did not work [FS#836] (10083)
- Fix: Memory leaks in the networking code [FS#846, FS#844] (r10082, r10075)
- Fix: Coverage area highlight was still show when it was turned off for docks [FS#835] (r10068)
- Fix: Do not use override engine type for articulated wagon parts (r10048)
2007-06-22 20:04:18 +00:00
rubidium 4b6d1f9027 (svn r9851) [0.5] -Backport from trunk (r9731, r9741, r9743, r9753, r9757):
- Fix: when you have closed the "Load game"/"New game" windows which you started from the "start server" menu, you shouldn't start a server when starting a new game [SF#1244842] (r9757)
- Fix: Trains were lost after autorenewal/autoreplace [FS#732] (r9753)
- Fix: Stop flooded towns from building roads on water [FS#598] (r9743)
- Fix: Station signs were not resized when the language changed [FS#672] (r9741)
- Fix: In news history, newlines were not replaced with spaces [FS#677] (r9731)
2007-05-15 21:42:27 +00:00
Darkvater 3b2bcbf0f0 (svn r8874) [0.5] -Backport from trunk (r8744, r8685):
- Call GetFirstVehicleInChain only for trains thus increasing performance in large games (r8744)
 - (Feature) Selecting "end of orders" and deleting will delete all the vehicle's orders (in unshared mode, shared is unchanged) (r8685)
2007-02-24 01:47:26 +00:00
Darkvater edc2ac8bbf (svn r8870) [0.5] -Backport from trunk (r8684, r8709, r8738, r8777, r8828):
- Bool (uint32 in PPC) was written to as a uint8 (r8684)
 - Fix a problem where loading times for overhanging trains are miscomputed (r8709)
 - Load newer TTDP games (update coastal tiles) (r8738)
 - Cloning unaware of articulated locomotives that could refit without refitting the front unit (r8777)
 - Load station rectangle for all savegames, not only after version 27 (r8828)
2007-02-24 01:02:15 +00:00
rubidium 0543461f5e (svn r8626) [0.5] -Backport from trunk (8294, 8296, 8536, 8540, 8609):
-Fix: deleting a vehicle with shared orders, but no orders would fail to reset prev_shared and next_shared
-Fix: GenerateVehicleSortList()/CmdMassStartStopVehicle() tried to put a TileIndex into an uint16
-Fix (FS#577): Road Vehicles now can obtain a slot even if the station is very spread out 
-Fix[YAPF]: Assert when buoy is placed on NE or NW map edge (Dan)
-Fix: a road vehicle that is very close after another (slower) road vehicle gets its speed reset to 0 when entering a tunnel, which causes a traffic jam outside of the tunnel.
2007-02-08 10:41:45 +00:00
rubidium 03bfa6e525 (svn r8623) [0.5] -Backport from trunk (8593, 8608, 8619, 8620)
-Fix (FS#564): bridges do not get destroyed when the bridge head gets flooded and there is a vehicle on the bridge.
-Fix: you were unable to build roads in the scenario editor when there is no town 0, even though there are other towns. 
-Fix: store the ownership of a water tile in the buoy tile and set the ownership of the water tile when the buoy is removed. This solves the issue of removing ownership from canal tiles thus making is possible for other players to remove the canal tile.
-Fix: buoys on canal tiles do not flood anymore.
2007-02-08 10:00:22 +00:00
Darkvater 6c3b245d88 (svn r8182) -Backport from trunk (r8137, r8147, r8157):
- (FS#551) roadstop->num_vehicles was wrong for old savegames loaded for MP (r8137)
 - v->leave_depot_instantly was not always reset correctly (r8147)
 - moving cargo during auto replaces did not update the cached vehicle weight for trains properly (r8157)
 *NOTE* This fixes several desync issues. Big props to Rubidium for finding, debugging
 and fixing them!
2007-01-17 01:23:50 +00:00
Darkvater bb9c6c5fc5 (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)
2006-12-21 20:56:27 +00:00
Darkvater 9b9add65c3 (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.
2006-12-21 10:29:16 +00:00
rubidium 9a0917141b (svn r7448) -Fix (r5794): use the height of the edge of the map for effect vehicles that are outside the map. 2006-12-09 08:37:15 +00:00
bjarni 4adc6ba4f8 (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
2006-12-05 22:59:42 +00:00
bjarni 686a0d7750 (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
2006-12-05 22:40:42 +00:00
matthijs 9218fc16e6 (svn r7372) - CodeChange: Rename all GetXXXArraySize() functions to GetNumXXX() and add GetMaxXXXIndex() functions. This prepares for the new pool interface. 2006-12-05 13:58:20 +00:00
matthijs 231111ce3d (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].
2006-12-03 17:27:43 +00:00
peter1138 039794e83c (svn r7326) -Feature: Add support for gradual (un)loading of vehicles (Maedhros) 2006-12-02 16:56:32 +00:00
peter1138 6a2583c43f (svn r7115) -Fix [FS#371]: Cloning a vehicle that has been refitted would incur the expense as running costs, not new vehicles. 2006-11-08 17:44:17 +00:00
tron 953344fdcc (svn r6975) Use the pool macros for the Vehicle pool 2006-10-28 10:55:59 +00:00
peter1138 326fef684f (svn r6905) - Codechange: Copy cargo subtype when cloning vehicles. 2006-10-23 16:47:20 +00:00
Darkvater ee27bb497c (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.
2006-10-21 23:31:34 +00:00
peter1138 afb45b6f29 (svn r6788) - Codechange: Add and use a function to test if a string ID is a custom name. 2006-10-16 10:26:22 +00:00
bjarni c6c3284fd4 (svn r6698) -Code cleanup r6697: simplified getting the string of the vehicle type 2006-10-08 22:16:30 +00:00
bjarni 2e7dc02b91 (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
2006-10-08 21:46:05 +00:00
bjarni ec809c5d71 (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
2006-10-08 21:10:00 +00:00
bjarni b4974b9d7d (svn r6676) -Fix: [vehicle list windows] mass start/stop now works correctly in shared orders and station lists 2006-10-07 08:24:11 +00:00
bjarni 1e14976bbf (svn r6653) -Fix r6624: [autoreplace] autoreplace will no longer replace a vehicle if the old type can refit to the cargo types being used in the refit orders and the new one lacks one or more of those refit capabilities 2006-10-05 14:04:24 +00:00
bjarni ea075f78e0 (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
2006-10-05 12:59:28 +00:00
bjarni 16271dfaac (svn r6648) -Codechange: simplified CmdDepotMassAutoReplace() by changing a switch-case into using a function, that was added in r6647 2006-10-05 08:39:16 +00:00
bjarni ff6f83b56c (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.
2006-10-05 08:15:51 +00:00
bjarni 186f8f8867 (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.
2006-10-04 19:15:25 +00:00
bjarni f8f0bd4943 (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
2006-10-04 12:01:59 +00:00
bjarni ea63050d5f (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
2006-10-03 14:52:39 +00:00
peter1138 406d756c6f (svn r6602) - Feature: we now support NewGRF livery refits, as used by DBsetXL, amongst others. This requires a savegame bump to save the cargo subtype. 2006-10-01 12:25:31 +00:00
glx c0d971906e (svn r6590) -Fix r6588: killed MSVC warnings for real 2006-09-30 19:21:39 +00:00
bjarni 50689cc85a (svn r6588) -Fix r6582: killed some windows only warnings (thanks webfreakz for testing) 2006-09-30 17:13:39 +00:00
bjarni f91c43d792 (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
2006-09-30 13:39:34 +00:00
bjarni 043f72678f (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
2006-09-29 20:41:28 +00:00
bjarni 821d2f1417 (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)
2006-09-29 18:39:20 +00:00
bjarni 648c43dde7 (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
2006-09-29 17:41:00 +00:00
bjarni 5b60e371a6 (svn r6570) -Feature: added "start all" and "stop all" buttons to the vehicle lists 2006-09-29 11:30:48 +00:00
bjarni 371f080182 (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
2006-09-28 14:17:08 +00:00
bjarni 2579b68e34 (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
2006-09-27 22:44:39 +00:00
peter1138 653e7fa548 (svn r6532) - Feature: Add support for NewGRF sound effects. Currently sound priority isn't supported. 2006-09-27 18:17:01 +00:00
bjarni 5dbfb5c272 (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
2006-09-27 12:17:33 +00:00
bjarni 1d554da2fc (svn r6515) -Feature: added "start all" and "stop all" buttons to the depot windows 2006-09-26 19:20:35 +00:00
bjarni 8f4a4a81da (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)
2006-09-24 15:01:02 +00:00
peter1138 37e00dbef2 (svn r6474) - Add a patch option to control display of liveries, allowing none, your
own, or all companies.
2006-09-17 20:52:54 +00:00
bjarni 7d1baa32bf (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)
2006-09-16 22:09:26 +00:00
bjarni 3d3d9a11bd (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
2006-09-16 16:21:47 +00:00
peter1138 851874d8e1 (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. 2006-09-15 17:36:54 +00:00