Commit Graph

178 Commits

Author SHA1 Message Date
rubidium 1d0d7635e0 (svn r22021) -Fix (r22019): ofcourse make doesn't notice files are gone, so it doesn't recompile everything that needs to be recompiled... 2011-02-07 22:49:38 +00:00
terkhen 734994c9ba (svn r21924) -Codechange: Unify some parts of the articulated vehicle code.
-Cleanup: Avoid conversions to Train and RoadVehicle that are no longer required.
2011-01-29 17:30:25 +00:00
rubidium 12b64a12b0 (svn r21910) -Codechange: rename some autoreplace internal functions so they don't collide with globabl functions 2011-01-26 17:30:17 +00:00
terkhen 48b7916458 (svn r21521) -Codechange: Unify some cached values that were present in both road vehicles and trains. 2010-12-14 21:33:53 +00:00
alberth 7e48d85104 (svn r21060) -Doc: Improved wording of comments (mostly by __ln__) 2010-10-30 17:51:07 +00:00
rubidium 30f2afac9b (svn r20632) -Cleanup: remove "a few" unneeded includes, and add them to some headers 2010-08-26 22:01:16 +00:00
frosch 514edcc19d (svn r20583) -Fix: Autoreplace failed while attaching non-replaced wagons to the new chain, if to-be-sold-engines would become front-engines and the unitnumber limit would be exceeded. 2010-08-20 17:36:09 +00:00
rubidium 646fbb628a (svn r20572) -Codechange: free/reserve some bits in the wagon move command to increase the vehicle pool limit 2010-08-19 20:42:00 +00:00
rubidium e89a0fb7f9 (svn r20571) -Codechange: free/reserve some bits in the order commands to increase the vehicle pool limit 2010-08-19 20:39:12 +00:00
frosch ed4f806f1d (svn r20283) -Codechange: Unify start of doygen comments. 2010-08-01 19:22:34 +00:00
alberth 9f8d730cc4 (svn r20277) -Codechange: Move CmdSetAutoReplace() from company_cmd.cpp to autoreplace_cmd.cpp. 2010-08-01 14:43:39 +00:00
frosch 2e90f7f8b9 (svn r19670) -Codechange: Add CeilDiv() and RoundDiv() to simplify integer divisions with rounding. 2010-04-18 14:56:05 +00:00
alberth 05d705e077 (svn r19494) -Codechange: Remove _error_message. 2010-03-20 17:58:24 +00:00
alberth 7d9a970c5c (svn r19417) -Codechange: More code style, move variable declarations to their first use. 2010-03-14 14:01:53 +00:00
alberth 7cc68f493d (svn r19405) -Codechange: CheckOwnership() returns a CommandCost. 2010-03-13 17:11:28 +00:00
frosch a3168269f9 (svn r18931) -Fix: Disabling autoreplace rules might count invalid engines. 2010-01-27 20:54:05 +00:00
rubidium aaf0b4b46c (svn r18812) -Codechange: make some functions in train.h functions of Train. 2010-01-15 18:23:52 +00:00
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00
frosch 1e1fa9ff2e (svn r18566) -Codechange: When both the union and intersection of refit masks of articulated vehicles are needed, they can be determined at once. 2009-12-20 14:28:55 +00:00
rubidium 4250792389 (svn r18499) -Fix/Change/Feature [FS#3159]: autoreplace and autorenew always reset their cargo sub type to 0. Now find a sub cargo type with the exact same name and use that, otherwise fallback to 0. So cargo sub types can be maintained via autoreplace *if* the new vehicle supports the same cargo sub type. 2009-12-14 19:19:47 +00:00
rubidium 138e7233bc (svn r17800) -Codechange: first steps into making CargoList a template 2009-10-18 14:28:26 +00:00
frosch 9a9d0ee7c0 (svn r17728) -Cleanup: Remove some more unneeded/unused parameters. 2009-10-06 19:52:38 +00:00
frosch f3aacb8fe3 (svn r17725) -Codechange: Reduce usage of EngInfo and XxxVehInfo, esp. when a Engine * is already present. 2009-10-06 19:17:07 +00:00
rubidium d6cded5380 (svn r17693) -Cleanup: remove some unneeded includes 2009-10-04 17:16:41 +00:00
rubidium e8ddf001c8 (svn r17570) -Fix: a number of Doxygen warnings about missing parameters, which were sometimes missing and sometimes just typos 2009-09-19 09:51:14 +00:00
rubidium 04d5b67eb6 (svn r17567) -Fix: some doxygen warnings 2009-09-18 14:23:58 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
frosch 52f9b8ffbd (svn r17147) -Fix [FS#3048]: Keep vehicle news and viewports following vehicles, when autoreplacing/renewing them. 2009-08-10 20:06:39 +00:00
rubidium 4b2592dbc0 (svn r17062) -Change: unify the naming of some 125 strings 2009-08-04 18:04:33 +00:00
smatz 6a0855f0d1 (svn r16723) -Codechange: make GetNextArticPart(), GetLastEnginePart(), GetNextVehicle(), GetPrevVehicle(), GetNextUnit(), GetPrevUnit() members of Train 2009-07-02 12:10:39 +00:00
smatz d86e17d65a (svn r16719) -Codechange: make IsArticulatedPart(), IsTrainEngine(), IsTrainWagon(), IsMultiheaded(), EngineHasArticPart() and IsRearDualheaded() members of Train 2009-07-01 23:57:20 +00:00
smatz adc5363202 (svn r16717) -Codechange: make IsFrontEngine() member of Train 2009-07-01 22:22:01 +00:00
rubidium 985608c713 (svn r16694) -Fix [FS#2995] (rgradual loading, rnewindustries): only pay for whatever has been actually unloaded and perform the payment when unloading has finished. This fixes, amongst others:
* cheating by starting to unload and after getting paid rushing to the depot to get sold (or unloading, loading and getting paid again for the remainder)
 * cargo being dropped onto a station at the moment a stockpiling industry doesn't accept it anymore
 * industries getting cargo that has not been unloaded yet and subsequently dumping it back on the station in one go
Note: you will now get paid after the unloading has finished, so you'll have to wait a bit longer for 'your' money.
2009-06-29 19:55:36 +00:00
frosch 1e09854cb7 (svn r16679) -Codechange: Let GetCapacityOfArticulatedParts() return a CargoArray instead of a pointer to a static array. 2009-06-27 21:36:04 +00:00
smatz 0c10006907 (svn r16527) -Codechange: use static member functions instead of simple casts when converting Vehicle to specialised vehicle types. Includes safety check 2009-06-06 16:54:22 +00:00
frosch 0d782b0f96 (svn r16498) -Codechange: Remove hardly used HASBITS. 2009-06-01 15:01:54 +00:00
rubidium da5661a0c8 (svn r16393) -Codechange: move VehicleRail to Train. 2009-05-22 22:55:41 +00:00
rubidium c4b627af42 (svn r16392) -Codechange: move some variables (the ones that aren't caches) from VehicleRail to Train 2009-05-22 22:33:05 +00:00
rubidium 80e94b9bb1 (svn r16391) -Codechange: use Train instead of Vehicle where appropriate. 2009-05-22 22:22:46 +00:00
smatz 70aab8bf04 (svn r16354) -Codechange: use 'new' pool accessors and methods for Engine too 2009-05-18 19:32:16 +00:00
smatz 8808f3beea (svn r16352) -Codechange: use PoolItem::GetIfValid() instead of PoolItem::IsValidID() and PoolItem::Get() 2009-05-18 16:21:28 +00:00
smatz 871107f529 (svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index) 2009-05-17 01:00:56 +00:00
smatz 6221d74644 (svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index) 2009-05-16 23:34:14 +00:00
yexo 31eff1d4c3 (svn r16315) -Codechange: move the autorenew settings to a new CompanySettings struct 2009-05-15 23:55:06 +00:00
frosch afe547448e (svn r15692) -Fix [FS#2721]: Just sell the old engines after autorenew/replace. Don't bother about trains exceeding the trainlimit, which will be sold anyway. 2009-03-12 19:40:16 +00:00
smatz c2834412f7 (svn r15680) -Cleanup: remove redundant comment 2009-03-12 10:42:02 +00:00
rubidium d846eef0b6 (svn r15434) -Codechange: bit of type safety for the DC_xxx flags. 2009-02-09 21:20:05 +00:00
smatz 0d3f5e6e74 (svn r15299) -Cleanup: remove many redundant includes 2009-01-31 20:16:06 +00:00
rubidium 87e5a8b52b (svn r14754) -Codechange: get rid of _cmd_text and just pass it as (optional) parameter. 2008-12-28 14:37:19 +00:00
frosch 1358756071 (svn r14442) -Fix (r14406): Typo causing problems in rare cases. 2008-10-05 18:42:59 +00:00
rubidium b650a86e58 (svn r14422) -Codechange: also reflect the changes of r14421 in the filenames. 2008-09-30 20:51:04 +00:00
rubidium 3b798599b6 (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with. 2008-09-30 20:39:50 +00:00
frosch 1032dbe142 (svn r14411) -Fix (r14406): IsFrontEngine() is only valid for trains. 2008-09-28 15:07:03 +00:00
frosch 76c13beef0 (svn r14407) -Cleanup (r14406): Remove a redundant test. (thanks SmatZ) 2008-09-27 17:08:03 +00:00
frosch 67db5087cd (svn r14406) -Fix [FS#Eddi]: Autoreplace did not work for vehicles in free wagon chains. 2008-09-27 14:58:46 +00:00
smatz 5f4ff33ce3 (svn r14337) -Codechange: use CmdRename* and CMD_RENAME_* for vehicle, president and company renaming commands, too 2008-09-15 22:58:41 +00:00
rubidium fc62d736f7 (svn r14306) -Codechange: unify the code to draw the vehicle list.
-Fix [FS#2292]: inconsistency between drawn vehicle lists in the vehicle list and group windows.
2008-09-13 10:04:36 +00:00
smatz c9bef19043 (svn r14174) -Fix: since now, we are 'losing' things, not 'loosing' 2008-08-25 20:10:45 +00:00
frosch 0e2736399e (svn r14126) -Codechange (r14125): Add some tabs. 2008-08-21 20:45:52 +00:00
frosch 447d0930f7 (svn r14125) -Fix [FS#2237]: Segfault when autoreplace failed very early.
Note: Proper indenting in next commit.
2008-08-21 20:42:45 +00:00
frosch 11a20379f3 (svn r14091) -Cleanup (r14083): Remove superfluous '#include's. 2008-08-17 11:49:35 +00:00
frosch 9751fbe4dc (svn r14085) -Cleanup (r14083): Remove no longer used functions. 2008-08-16 14:15:32 +00:00
frosch f7826f8a37 (svn r14083) -Fix [FS#1264, FS#2037, FS#2038, FS#2110]: Rewrite the autoreplace kernel. 2008-08-16 14:02:20 +00:00
frosch 4eae917c1c (svn r14037) -Fix (r8610): The autoreplace gui showed vehicle types for replacement which CmdSetAutoReplace() did not accept. 2008-08-10 15:02:21 +00:00
frosch 731685cf64 (svn r14031) -Fix (r13850): Determining the refit cargo did not work, when the old vehicle did not carry anything but the new one did. 2008-08-09 16:42:55 +00:00
frosch 1f31e117f0 (svn r13850) -Fix [FS#2146]: Fix resp. implement refitting of articulated vehicles during autoreplace. 2008-07-27 15:17:16 +00:00
smatz aae2aa64c4 (svn r13816) -Fix [FS#2150]: check for vehicle length changes outside a depot (callback 0x11) and give a warning about that 2008-07-24 15:19:26 +00:00
smatz 447ec39f49 (svn r13691) -Codechange: make it easier to determine whether a command is ran in the context of autoreplace or not 2008-07-09 20:55:47 +00:00
rubidium 9717e1ef07 (svn r13146) -Codechange: vehicle_base.h doesn't need to be included in vehicle_gui.h. 2008-05-17 20:54:18 +00:00
rubidium 76b8970a33 (svn r13100) -Codechange: reduce the amount of parameters passed via AddNewsMessage as there is (for each news message type) a tuple of 4 parameters that is the same for all calls. 2008-05-15 13:39:36 +00:00
bjarni d3650ecb3a (svn r13002) -Fix (r13001): [autoreplace] previous fix broke updating of a pointer to the front vehicle in certain cases
Now it's updated when it's the front vehicle and it's every time it's the front vehicle and only if it's the front vehicle (nomatter if the replacement works or not)
2008-05-07 23:00:11 +00:00
bjarni 02709df7e3 (svn r13001) -Fix [FS#1994](r12913): [autoreplace] we should stop working on vehicles right away if we fail to replace them and certainly not presume their data is valid 2008-05-07 22:08:20 +00:00
bjarni dbf6e344a4 (svn r12940) -Fix [FS#1974](r12913): [autoreplace] a vehicle backup should include the cargo packets in the vehicle as well 2008-05-04 10:05:35 +00:00
bjarni 757de2bdf5 (svn r12913) -Add: ability to backup and restore a player's economic data and data for a vehicle (or chain of vehicles)
Autoreplace uses this with the following benefits:
  -Mass autoreplace (the button in the depot window) will now estimate costs correctly
  -Autoreplace now either replaces correctly or manages to keep the original vehicle (no more broken trains)
  Thanks to Ammler for testing this
2008-04-27 20:09:29 +00:00
bjarni de015fbf90 (svn r12797) -Codechange: [autoreplace] moved wagon removal to a function of it's own 2008-04-19 22:51:52 +00:00
bjarni c360e71e3c (svn r12794) -Doc: added missing doxygen comment in autoreplace_cmd.cpp 2008-04-19 19:01:57 +00:00
bjarni 01549e1574 (svn r12792) -Codechange: [autoreplace] added a function to figure out if a replacement is needed and if so, to which EngineID
It's designed to save a bit of CPU time, specially if the replacement isn't buildable (think autorenew of old vehicle)
2008-04-19 17:47:56 +00:00
bjarni ad3ef0fb26 (svn r12791) -Codechange: [autoreplace] Added a flag parameter (listens for DC_EXEC and DC_QUERY_COST) and included more info when returning CommandCost
This allowed cleaning up the code in MaybeReplaceVehicle()
2008-04-19 15:14:20 +00:00
rubidium 02cdf01507 (svn r12754) -Codechange: split depot.h into depot_map.h, depot_func.h and depot_base.h and remove quite a lot of unneeded (before this) includes of depot.h. 2008-04-17 19:10:30 +00:00
rubidium e68b2088ce (svn r12586) -Codechange: do not access an order's refit variables directly. 2008-04-06 07:07:21 +00:00
rubidium ef2be7d0fc (svn r12490) -Codechange: rename engine.h to engine_func.h and remove unneeded inclusions of engine.h and/or replace them with engine_type.h. 2008-03-31 00:17:39 +00:00
rubidium 4a1035ab95 (svn r12488) -Codechange: split order.h into order_base.h and order_func.h. 2008-03-30 23:24:18 +00:00
rubidium eeabab4555 (svn r12459) -Codechange: split news.h into news_type.h and news_func.h. 2008-03-28 08:53:36 +00:00
bjarni 06c0e5df5a (svn r12421) -Feature: [autoreplace] the autoreplace button in train depots will now also replace wagons even if they aren't connected to a locomotive
fixed estimated cost in CmdDepotMassAutoReplace() (will still not estimate wagon removal profits)
  Made it possible to command CmdDepotMassAutoReplace() to either replace everything or nothing (the button will still happily replace just some of the vehicles if cash premits)
2008-03-25 21:58:13 +00:00
frosch 8f556828f0 (svn r12346) -Fix [FS#1748, FS#1825](r9874, r11872): Remove duplicated and inconsistent code wrt. autoreplace with rules in both vehicles' group and ALL_GROUP. 2008-03-06 10:39:26 +00:00
bjarni 8290a798fc (svn r12231) -Cleanup (r12230): [autoreplace] moved Vehicle::NeedsAutorenewing() and added comments 2008-02-23 22:23:06 +00:00
bjarni 089969e1ca (svn r12230) -Codechange: [autoreplace] made a function to detect if a vehicle needs autorenewing
This will remove duplicated code and ensure that the check is consistent
2008-02-23 22:01:55 +00:00
belugas fc4f6dcfb1 (svn r12040) -Codechange: Change IsOrderListShared from a simple function to a class member(MagicBuzz). 2008-02-02 02:45:09 +00:00
bjarni e91230415d (svn r11929) -Fix (r9981)[FS#1624]: [autoreplace] fixed a case where a single headed locomotive caused an assert when being replaced to a dualheaded one
This triggered if the player had enough money to replace and refit one of them but not enough to refit the last one as well
2008-01-19 23:34:52 +00:00
bjarni 2f6ee3a4a1 (svn r11928) -Fix (r6393): [autoreplace] autoreplace could refit train engines to the wrong cargo type if the old engine had no cargo capacity and the new one had
Now autoreplace will always look at the wagons to figure out what to replace to (as originally intended)
2008-01-19 22:47:07 +00:00
rubidium d4e6a6bf57 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h. 2008-01-13 01:21:35 +00:00
peter1138 ab8382c0db (svn r11822) -Codechange: Replaced fixed size custom name array. Names are now attached to their object directly and there is
no limit to the amount of names.
-Fix: NewGRF engines could not be renamed.
2008-01-12 19:58:06 +00:00
rubidium ac528411df (svn r11818) -Codechange: split player.h into smaller pieces. 2008-01-12 14:10:35 +00:00
rubidium 46650c54b6 (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114). 2008-01-09 16:55:48 +00:00
rubidium a8a3a7e3f2 (svn r11775) -Codechange: move all autoreplace/autorenew functions to a single location. 2008-01-07 09:19:53 +00:00
rubidium b0ac283aec (svn r11774) -Change: do not include variables.h in a header when it is not needed. 2008-01-07 00:57:19 +00:00
rubidium 384503e7d3 (svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes. 2007-12-27 13:35:39 +00:00
rubidium 429521a7d1 (svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h' 2007-12-25 11:26:07 +00:00
rubidium 9e9cfe6e59 (svn r11677) -Codechange: move price and command related types/functions to their respective places. 2007-12-21 21:50:46 +00:00
rubidium 433a9f3c09 (svn r11675) -Codechange: split the string types from the string functions. 2007-12-21 19:49:27 +00:00