Commit Graph

111 Commits (a9d33943d734671990920fc093d0025845479370)

Author SHA1 Message Date
Darkvater e8cf6ec8fd (svn r3716) - Move the option settings (_game_opt_desc) from misc.c into settings.c. This will be merged with SettingDesc misc_settings above as they are actually the same. No functionality has changed beside the fact that the settings are now in a different Chunkhandler. 19 years ago
Darkvater 6d89d2bfa1 (svn r3626) - Merge the SlGlobVarList (global variables) and SaveLoad (offset in struct, variable determined runtime) structs. The only difference between these two is the last element that either holds the address or the offset in the struct. Which one to take is determined by which function is called; SlObject or SlGlobList. 19 years ago
tron 7692556c62 (svn r3613) Some more const, indentation, whitespace and similar stuff 19 years ago
tron 087fe86ed2 (svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
19 years ago
tron 1c3e8630fe (svn r3511) More whitespace ([FS#46] by Rubidium) 19 years ago
tron 9712d6f639 (svn r3510) Fiddle with whitespace and parentheses 19 years ago
peter1138 c56ae910f0 (svn r3409) - Change the server advertisement interval to use the frame counter instead
of game days. This allows a paused server to continue to advertise itself.
  This also fixes advertising for games that start before 1922.
19 years ago
peter1138 2222907a40 (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)
19 years ago
truelight 45a0cc607c (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
-Fix: [ FS#30 ] don't reset date in SE when pressing RandomLand (rewrote patch of MeusH, but Peter warned me I should put his name in, so... oh well)
19 years ago
truelight a518f81093 (svn r3250) -Fix: AIs weren't uninitialized when a new game was loaded 19 years ago
truelight 898bb915ac (svn r3227) -Codechange: [Savegame] removed 'minor' version, and renamed 'major' version to just: version. 19 years ago
tron 0b936c3222 (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
19 years ago
tron 6d7c7e67b2 (svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them 19 years ago
Darkvater 78e4cbbfda (svn r2956) - Fix: [ 1253736 ] creating many town crash to desktop. Now it 'dies' with an ingame error message informing the gamer if it couldn't generate any towns in user-space. Still if it happens during new-game generation it crashes since we don't yet have actions to do in such a circumstance. 19 years ago
tron 8b74a95d36 (svn r2886) Rename the "owner" attribute to "m1", because when it stores an owner it is accessed by [GS]etOwner anyway and when it doesn't store an owner, but arbitrary data, accessing a field called "owner" is confusing. 19 years ago
tron b3ee1aad26 (svn r2832) Missing #include 19 years ago
tron 486cffd2ad (svn r2819) Make variables, which are exclusive for internal use of the save/load code, static in saveload.c 19 years ago
bjarni 9952ff0b59 (svn r2817) -Codechange: [autoreplace]: moved autoreplace and autorenew to serverside
-This means that one company can only have one setting for renew and replacing
    more clients will not fight due to different settings anymore
  -This is a needed step in the line to fix autoreplacing dualheaded locomotives
  NOTE: savegame revision bump (peter1138 + me in coop)
19 years ago
tron 842991bbe0 (svn r2812) Move variables, which only vehicle_gui.c needs to know about, there 19 years ago
tron 17b5b58136 (svn r2759) Remove unused #includes and files 19 years ago
tron 6bdedb51a6 (svn r2706) Fix !WITH_NETWORK build 19 years ago
tron 647cbd6bdd (svn r2701) Insert Id tags into all source files 19 years ago
tron 54cbd01825 (svn r2673) Include functions.h directly, not globally via openttd.h 19 years ago
tron 71140a5768 (svn r2669) Shuffle some more stuff around to reduce dependencies 19 years ago
ludde b998b9b8e6 (svn r2622) Fix: remove _cargoc.names_p, it was never used. 19 years ago
ludde f868fb0811 (svn r2600) Fix: [vehicles] Fix problem with vehicle loop not distributing the calls evenly over the day. 19 years ago
tron e7fa78d60b (svn r2596) Add macros ROL and ROR to ROtate values Left/Right. Also shorten the parameter names for GB and SB to increase readability 19 years ago
ludde 594dd34e84 (svn r2594) Fix: [strgen] Misc updates to the string system.
- Renamed the plural command to "P" instead of "PLURAL". Now write something like this to append an s on plural: {P "" s}. (You can optionally still add an argument index to explicitly specifiy which number that's used)
  - Removed the pluralized cargo strings from the string files. The new method is to use the plural specifier {P}
  - Added support for genders. First add "##gender der das die" on top, then use {G=der} on a cargoname/industry to set the gender, and to switch between genders do something like {G neu neu neue} {STRING}
  - Updated the swedish/english translation with P strings.
19 years ago
ludde 04e45dac34 (svn r2588) Codechange: Remove PLAYER_SEED_RANDOM 19 years ago
ludde fd0cee7418 (svn r2583) Move OS specific code out of misc.c
Added support for Mersenne Twister random number generator (not implemented in network yet)
Wrap player randoms around #ifdef
19 years ago
ludde 275e2f477a (svn r2572) - Codechange: [string] Changed string system so it's not as dependent on decode_parameters
- Feature: [strgen] Allow changing the order of parameters in translated strings.
  - Use {1:TOWN} syntax to set the order.
- Codechange: [strgen] Rewrote lots of strgen internals.
19 years ago
ludde 20b7c66f7f (svn r2565) Fix: Remove GetParamInt8, GetParamInt16, GetParamUint16.. they are just confusing and just do the same thing as GetParamInt32 19 years ago
ludde 2123deff13 (svn r2560) Fix: various minor code changes.
Added RandomTile/RandomTileSeed functions to generate a random tile.
Changed landscape routines so they don't assume that the Y map side is a power of two. (support for this is not complete, though)
Changed some frequently used map macros to not compute the values each time.
Silence some warnings on MSVC.
19 years ago
ludde ca9d0f9841 (svn r2559) Cleaned up new saveload code for the map 19 years ago
tron a4bf608d40 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes. 19 years ago
tron 6923badbba (svn r2505) Remove some unnecessary #includes 19 years ago
Darkvater c3c69ff5cb (svn r2420) - Codechange: magic number elminitation of cursorsprites. 19 years ago
Darkvater ba8c649fac (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 19 years ago
Darkvater f4f5cb93f8 (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.
19 years ago
Darkvater d1b068355c (svn r2316) - Fix: [ 1154454 ] Fix BeOS build on Trunk (myob) 19 years ago
matthijs f8302a137a (svn r2256) - Fix: Trains cannot find a depot when they are in a tunnel. (glx)
- Add: GetVehicleTrackdir() helper function.
- Codechange: Moved SortStruct from vehicle_gui.h to ttd.h, so the dependency from vehicle.h on vehicle_gui.h could be removed.
- Codechange: Typedeffed the VehicleTypes struct so it can be used as the type for Vehicle.type instead of "byte".
- Codechange: Removed prototype for VehicleSorter(), which had no implementation anymore and was never called.
19 years ago
truelight 555a78aaac (svn r2099) -Fix: no longer chat-messages hang when the game wraps around 2090
-Codechange: while trying to find this bug, made texteff.c a bit more readable :)
20 years ago
truelight d1e158d6f7 (svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.h
-Codechange: rewrote some functions while moving waypoint-stuff
-Add: added support for 64k waypoints
-Fix: made the waypoint struct a bit more logic (no bit-fucking)
20 years ago
truelight e51659da60 (svn r2042) -Fix: forgot to remove a printf ;) 20 years ago
truelight 49d69f6fa3 (svn r2041) -Fix: not all vehicles did get a day_proc call (because of rounding errors) 20 years ago
pasky 00ff85dcb8 (svn r2033) - Fix: Fix some more desync by saving the town growth frequency iterator _cur_town_iter. Needed to bump a svg revision for that thanks to the braindead SlGlob thing, or at least I don't know how to do it without bumping it. 20 years ago
celestar 239aa75504 (svn r2030) -Fix: Save _cur_town_ctr with all its bits to prevent desyncs 20 years ago
pasky 49f769948b (svn r2021) Fix: Enlarge _cur_town_ctr from byte to uint32 so that all the towns are considered when growing them even for big maps, where much more than 256 towns are around; reported by Tomasz Dubiński <uboottd@hydra.polsl.gliwice.pl>. The savegame still saves just the lowest 8 bits but that doesn't hurt so much. 20 years ago
pasky b5b85a6297 (svn r1950) Fix: A slight adjustment in the DoRandom() function which however causes dramatic improvement in the distribution of random numbers.
With the original generator, e.g. Random()%44 on 100 attempts regularily
generated only 22 different values! With this adjustment, the distribution is
much more uniform, almost approaching the glibc's random() call.

This means the random numbers are actually usable i.e.  for the town names
generators which almost never tried a large part of the names while others were
very frequent.

Note that we attempted to test whether the randomness did not degrade in some
other way, and it came clean from the tests we performed. If you spot anything
fishy, try without this patch, though.
20 years ago
tron ce896e2f99 (svn r1879) Revise name handling, no functional changes 20 years ago