Commit Graph

85 Commits

Author SHA1 Message Date
Darkvater e89a98d296 (svn r3952) - Fix: On loading a game, GetPlayerRailtypes() didn't account for the fact that vehicles are introduced a year after their introduction date. This will also relieve possible (rare) network desyncs. Backport of r3565 from trunk 2006-03-18 15:17:57 +00:00
peter1138 098300cc7d (svn r3423) - NewGRF: Update the base_intro age at which an engine will have a randomized intro date, as per (the now updated) spec. 2006-01-24 07:41:28 +00:00
peter1138 102f9be296 (svn r3410) - NewGRF fix: Only add a random number of days to an engine's base introduction date if that date is not 0. 2006-01-19 18:33:20 +00:00
peter1138 90aff7a026 (svn r3396) - Autoreplace changes:
- Change fixed array per player to a single pool. This avoids future problems
    with vehicle numbers and decreases savegame size. Engine replacements from
    previous savegames will be lost.
  - Move engine replacement code from players.c to engine.c.
                                      (thanks to blathijs for rewriting this)
2006-01-12 15:52:18 +00:00
peter1138 79ce0def50 (svn r3378) - NewGRF Fix: Use order status to determine whether a vehicle is loading instead
of speed, and get that state from first vehicle in a train consist.
2006-01-06 22:49:00 +00:00
tron e272b03fee (svn r3365) Staticise 36 functions 2006-01-05 12:40:50 +00:00
peter1138 3532b91eef (svn r3316) - NewGRF: Unload engine names before loading grf files. This fixes names in climates where the engines don't get loaded. Renamed function to reflect its purpose. 2005-12-18 14:03:28 +00:00
tron 28fe368b7f (svn r3308) BAD
foo.h: int bar;

GOOD
foo.h: extern int bar;
foo.c: int bar;
2005-12-15 17:55:59 +00:00
peter1138 7460ecd42a (svn r3252) - NewGRF: Map new train subtypes to old types for rail vehicles. 2005-12-02 14:55:23 +00:00
tron f7abff5f96 (svn r3181) -Bracing
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
2005-11-14 19:48:04 +00:00
peter1138 bc25cd89bf (svn r3148) -NewGRF, Feature: Add support for cargo refitting specification by cargo classes. 2005-11-06 13:42:26 +00:00
peter1138 267314b4d0 (svn r3139) -NewGRF, Feature: support for articulated rail vehicles. This is used, for example, by coal tenders. 2005-11-05 16:07:26 +00:00
peter1138 01b6109751 (svn r3126) Autoreplace: Only the first vehicle in a chain should be marked as entering a depot, so call moved out of DoVehicleTrigger loop. 2005-11-03 18:27:29 +00:00
bjarni 682b9ee8e4 (svn r3111) -Fix: [autoreplace] [ 1341783 ] Assertion failure in vehicle.c line 378
running MaybeReplaceVehicle() is now delayed until after the loop in CallVehicleTicks()
	This avoids selling the vehicle the loop currently works with (and continues to work with afterwards)
2005-10-31 12:59:47 +00:00
tron 2cc2154ad2 (svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in comments, excess empty lines, minor other changes
nothing spectacular, just some stuff, which piled up
2005-10-22 06:39:32 +00:00
tron f3de172560 (svn r3059) Use bitfields to encode railtype and climates of engines instead of manual shifting/anding 2005-10-18 11:23:58 +00:00
peter1138 abe60acbbb (svn r3017) -NewGRF: Implement sprite group unreferencing and unloading. 2005-10-04 21:42:00 +00:00
peter1138 c655e13e92 (svn r3016) -NewGRF: Implement the start of reference counting for sprite groups. This will allow unloading. 2005-10-04 20:58:10 +00:00
peter1138 d1591e864d (svn r3015) -NewGRF: Add a new sprite group result type, and support loading of callbacks results within random and "real" groups. (Not fully supported yet.) 2005-10-04 20:38:26 +00:00
peter1138 9fabe008a0 (svn r3014) -NewGRF, Codechange: Make all sprite group references be pointers instead of copying the data around. 2005-10-04 19:52:26 +00:00
tron 0cc45ecd8e (svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, plus some related changes (mostly casts) 2005-10-01 12:43:34 +00:00
tron ce1c72cf6e (svn r2995) Replace 0xFF/0xFFFF with CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate 2005-09-28 19:35:36 +00:00
tron a2c42e06ed (svn r2762) Simplify a loop, remove an unused variable and add many consts 2005-07-30 18:04:49 +00:00
tron af9f55c977 (svn r2720) Remove unused declarations and definitions 2005-07-26 19:34:03 +00:00
tron a16418266e (svn r2717) Move _userstring to strings.[ch] 2005-07-26 19:04:19 +00:00
tron a227065ab7 (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron 559babcdc9 (svn r2673) Include functions.h directly, not globally via openttd.h 2005-07-22 07:02:20 +00:00
tron 0762aa9ec9 (svn r2669) Shuffle some more stuff around to reduce dependencies 2005-07-21 22:15:02 +00:00
celestar 18a93cca3d (svn r2657) -Codechange: The available railtypes per player are now a bitmask, so
that railtypes do not be in ascending order of appearance. Allows easier
implementation or more railtypes
2005-07-20 22:02:58 +00:00
tron ac66e3e28f (svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read 2005-07-20 15:29:28 +00:00
hackykid fc43b1ba09 (svn r2494) - Fix: [newgrf] Dont assume a spriteset can only have 4 or 8 sprites. 2005-06-27 21:34:31 +00:00
celestar aa7334a3ec (svn r2468) -Codechange: Got rid of DEREF_PLAYER and replaced it by GetPlayer 2005-06-21 16:28:17 +00:00
tron fa8f46c0b7 (svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[] 2005-06-07 18:13:49 +00:00
hackykid 1018d3b786 (svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it. 2005-06-06 00:19:24 +00:00
hackykid 9ac03e7181 (svn r2410) - Fix: [newgrf] When resolving callbacks, dont ignore wagon overrides. 2005-06-05 05:35:12 +00:00
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +00:00
hackykid 351d7aaa9f (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
- Feature: [newgrf] Implement the 'refit capacity' callback.
2005-06-01 11:34:37 +00:00
Darkvater 55423efb06 (svn r2387) - CodeChange: made the saveload code more readable and also removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
- Fix: also fix an unnoticed error in SlSaveLoadConv() due to wrong types.
2005-05-30 22:16:05 +00:00
hackykid 726f86e020 (svn r2361) - Feature: [newgrf] Implement varaction2 property 0x41 and 0xDA. These are the position in and length of chain of consecutive vehicles with the same type, and index of the next wagon in the chain (INVALID_VEHICLE if last), resp. Improves displaying of some engines in the dbsetxl. 2005-05-22 14:10:20 +00:00
Darkvater cb5107f97f (svn r2345) - Fix: Don't allow stuff to be renamed to nothing if we don't support it. Only valid ones are signs (delete) and waypoints (rename to default). 2005-05-17 20:58:58 +00:00
tron fea5965679 (svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes. 2005-05-15 18:50:55 +00:00
Darkvater 5174d3adfe (svn r2306) - CodeChange: Check the last commands; refits. This needed an extensive rewrite and global/local-cargo ID juggling and bitmasking. However with this done it looks better as well and is compatible with newgrf handling. Big thanks to HackyKid for doing most of the work. This also closes patch "[ 1199277 ] Command checks" 2005-05-14 12:36:16 +00:00
Darkvater 5e6923e936 (svn r2290) - CodeChange: protect the next batch of commands. This brings us to a total of 61, which is 53% :)
- CodeChange: To correctly accept engine-prototypes, the best-player checking has been moved to its own function, I hope it functions the same as before.
- CodeChange: Added symbolic types of PlayerID, OrderID and EngineID. For engines also added GetEngine() and IsEngineIndex(), similar to the other such functions.
- CodeChange: To correctly build industries, some tables have been moved to build_industry.h. The only way to find out currently if an industry is valid in a climate is by looping all industries and checking if it matches. Also to comply with the patch setting build_rawmaterial_industries, it is assumed that these industries do not accept any cargo of any type. This can and probably should changed in the future to some flag in their struct. Also use _opt_ptr instead of _opt.
- CodeChange: implemented the HQ checking code inspired by MarkR2 in "[ 1190944 ] Many commands not checked for security".  Unfortunately it is impossible to prevent only deleting a HQ by a modified client atm.
- CodeChange: For insert order and modify order their parameters are implicitely truncated to 8 bits, instead of the 16 bits said in the comments.
2005-05-11 00:00:27 +00:00
pasky 339785dad7 (svn r2064) - Codechange: GetVehicleSpriteGroup() cleanup - drop overriding_engine, which was around probably only for historical reasons. (Paralellily developed by HackyKid.) 2005-03-25 16:07:35 +00:00
pasky 7fceb7ea86 (svn r2063) Fix: the 0x40 deterministic spritegroup for vehicles was wrong, modified to match the wiki again. (The wiki was partially wrong, too! ;) (Patch by HackyKid.) 2005-03-25 15:31:01 +00:00
truelight 9b1e6e6d3e (svn r2043) -Fix: committed too many files in the last commit 2005-03-24 14:33:05 +00:00
truelight fbb11ea366 (svn r2042) -Fix: forgot to remove a printf ;) 2005-03-24 14:31:27 +00:00
tron 4bf173e9c1 (svn r1981) Typedef some structs and enums 2005-03-10 07:01:43 +00:00
tron e5121e70d0 (svn r1979) Const correctness 2005-03-09 21:54:52 +00:00
Darkvater 9bd079d425 (svn r1978) - Fix: Plug some memleaks; thanks Valgrind 2005-03-09 19:48:20 +00:00