Commit Graph

137 Commits

Author SHA1 Message Date
Darkvater 78fa9c7393 (svn r3427) - Feature: Allow seeing and setting the maximum amount of companies and spectators for a server. This can be changed/viewed during runtime as well in the console. 2006-01-25 18:11:06 +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
tron e272b03fee (svn r3365) Staticise 36 functions 2006-01-05 12:40:50 +00:00
peter1138 eeeebf9f6d (svn r3359) - Autoreplace GUI: When starting or stopping a replacement, redraw the replace window after the command has completed, rather than after calling the command. 2006-01-02 19:55:09 +00:00
peter1138 878c868f02 (svn r3343) Fix calculation of available rail types where all engines of a particular type are obsolete. 2005-12-26 15:41:24 +00:00
tron cc2b51320f (svn r3300) Remove unreachable code - in this case some duplicate breaks 2005-12-14 06:49:54 +00:00
peter1138 87f54ebf92 (svn r3239) - Codechange: Introduce and use helper functions for engine replacement code. 2005-11-26 16:41:14 +00:00
truelight 6a4ba84320 (svn r3226) -Fix: GPMI implementation had minor glitches
-Fix: the AI speed control is done by the AI-core, individual AIs don't have to do it (so, AIs were delayed twice ;)
-Add: Support for AI-network-clients (an AI, connecting to a remote server)
-Fix: minor AI-core problems
2005-11-22 15:55:38 +00:00
truelight 31f218fdf9 (svn r3224) -Add: Allow the NewAI to work in Multiplayer Games (switchable via patch
settings, off by defaut). An other step to AIScripts.
      WARNING: this is still highly experimental and has known bugs!
2005-11-21 14:28:31 +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
tron 833032adc0 (svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT 2005-11-14 08:09:57 +00:00
tron 357aba7475 (svn r3176) Use proper types, not some variants of int 2005-11-13 21:16:34 +00:00
bjarni 5481dcd191 (svn r3155) -Feature: [autoreplace] autoreplace can now remove cars from too long trains
-Trains will now remember the length of stations it visits and sell cars
        when being autoreplaced if they became too long
        -If it needs to remove cars, then it starts from the front and sells
        all it can find until the train is short enough
        -This only works for trains, that knows the station length of the route
        so a full uninterrupted run is needed
        -a train needs 1-2 runs to detect if the shortest station is expanded
        -This feature can be turned on and off in the train replace window
        and each company can have it's own setting
        -NOTE: minor savegame version bump
2005-11-07 23:20:47 +00:00
Darkvater 723e789b2f (svn r3154) - Fix: Last value of an array is lengthof-1; let's keep this at a typo, shall we :P 2005-11-07 17:31:21 +00:00
Darkvater f816b74536 (svn r3151) - Fix: showing the highscore might crash the game with an invalid string message in the case when a highscore file was used before certain strings were added.
- Codechange: protect _endgame_perf_titles from out-of-bounds access.
2005-11-07 13:30:43 +00:00
peter1138 7298b0b31b (svn r3109) Replace two occurrences of '256' with TOTAL_NUM_ENGINES 2005-10-31 11:22:52 +00:00
tron 66e688cba3 (svn r3087) Rewrite GetPlayerRailtypes() so it doesn't depend on magical numbers to sort out wagons 2005-10-25 18:29:32 +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 2b91f55b32 (svn r3073) int/byte -> EngineID/PlayerID/VehicleID
0/-1 -> INVALID_ENGINE
0x10 -> OWNER_NONE
2005-10-20 17:43:13 +00:00
tron 758ae7e8f6 (svn r3064) Replace some numbers by sprite names 2005-10-19 06:46:41 +00:00
tron 3397e202c8 (svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants 2005-10-07 07:35:15 +00:00
tron db3b1228bf (svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them 2005-10-03 21:20:01 +00:00
tron ed8c9c91d6 (svn r3001) s/Player*/const Player*/
s/byte/PlayerID/
s/int/PlayerID/
and related changes
2005-09-30 20:37:25 +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
Darkvater 8e6a911700 (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
- change a lot of byte player types to PlayerID
- beautify header files, same "#endif /* filename */" ending
2005-09-18 20:56:44 +00:00
Darkvater 2131f68ae2 (svn r2951) - Fix: [ 1259345 ] Changing engine in netgame opens train window for everyone
- Add IsLocalPlayer() which substitutes _local_player == _current_player
2005-09-14 18:03:38 +00:00
truelight 991d5c6234 (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
-Fix: removed the ability for the oldAI to cheat (this will criple him somewhat)
-Add: base-code for many improvements to come in the AI-system
-Add: added base-code for multiplayer AIs (DOES NOT WORK YET!)
2005-09-07 15:10:11 +00:00
truelight d05f504c01 (svn r2907) -Codechange: splitted the AIs to their own directory. AINew becomes 'trolly', AIOld becomes 'default', both in their own dir in the 'ai' dir. More AIs to come. 2005-09-02 19:10:45 +00:00
bjarni ed8e2bac04 (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)
2005-08-06 16:07:22 +00:00
tron af9f55c977 (svn r2720) Remove unused declarations and definitions 2005-07-26 19:34:03 +00:00
celestar 238e47cd42 (svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
by enums. There remains work in gfx.c to move the "transparency" and
"recolor" bits around to make space for more sprites. However, 2800
additional sprites can now be loaded. There also remains cleanup and
Doxygen work on many of the header files.
2005-07-24 15:56:31 +00:00
tron a227065ab7 (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron af1d719856 (svn r2684) Correctly save and load company_value, it's 64 bits wide, not 32 bits 2005-07-23 06:51:26 +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
tron e53c4db866 (svn r2664) Remove depedency on player.h from variables.h 2005-07-21 19:36:43 +00:00
tron d71788c402 (svn r2660) Get rid of some more shifting/anding/casting 2005-07-21 06:31: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
truelight dcd97a431b (svn r2629) -Codechange: removed stupid comment on top of players.c 2005-07-18 23:33:14 +00:00
Darkvater ff2662ebe7 (svn r2617) - Fix: fix some warnings, and reenable vs.net2003 signed/unsigned warnings 2005-07-17 18:11:17 +00:00
truelight a09342c1fc (svn r2606) -Codechange: renamed ai.c to ai_old.c, and ai.h to ai_new.h to make room
for a global AI-handler
2005-07-17 15:34:10 +00:00
truelight 658f9cb03f (svn r2602) -Codechange: removed unused variable (disable_computer)
-Fix: Changed some stuff to make server-side AIs possible in the far future
2005-07-17 13:34:19 +00:00
ludde 3486e7e9d5 (svn r2580) Change: Added {INDUSTRY} command for printing industry names instead of the old {TOWN} {STRING} way.
- The formatting of the industry name can be controlled with the string STR_INDUSTRY_FORMAT.
Change: Changed several occurences of {STRING1} into {TOWN} to get rid of townnametype being used directly.
2005-07-15 18:30:13 +00:00
tron 3154e7148d (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile" 2005-06-24 12:38:35 +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 0c4ecbe9ec (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner 2005-06-04 11:56:32 +00:00
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +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
Darkvater 54b7fb0203 (svn r2339) - Fix: on a dedicated server, after the joining of a player, the player was set to player 0 instead of remaining OWNER_SPECTATOR. Fix this, and allow the dedicated server to execute commands (so 'patch <value>') now works and not only when a client is connected. 2005-05-17 18:22:59 +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 6f06930ee3 (svn r2316) - Fix: [ 1154454 ] Fix BeOS build on Trunk (myob) 2005-05-14 23:48:39 +00:00
Darkvater 033995ec6e (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
- CodeChange: remove cmd-misuses CmdStartScenario() and CmdDestroyCompanyHQ()
- Fix (invisible): when parameter checking CmdRestoreOrderIndex() the vehicle did not have its orders yet, so it would fail. So move doing this until AFTER the orders have been added back in RestoreVehicleOrders()
2005-05-12 23:46:01 +00:00
Darkvater 6cdb9580e2 (svn r2291) - Fix (regression): When a client joined it changed the server-player's name. Funny effect; but not desired. Thanks for pointing it out Tron. It needed a bit of hacking, but is not less of a hack than the one used before :) 2005-05-11 12:46:19 +00:00
pasky 0c5d61bd56 (svn r2080) - Fix: [OldAI] p->ai.state_counter was uint16 but could hold a tile index, therefore overflowing - changed that to uint32 and bumped the savegame revision to 32. It *MIGHT* close bug 1151374 - it certainly caused AI to stop building anything sometimes.
- While at it, use TileIndex as the tile index type in AiRemovePlayerRailOrRoad() and AiStateRemoveTrack().
- Make the number of tiles scanned 4*MapSizeX() instead of 1000. It *MIGHT* close bug 1116614.
2005-03-27 00:28:14 +00:00
Darkvater 0ddbc1304b (svn r1906) - Fix: [ 1117327 ] Assertion error on kick. When a company is cleaned all its windows need to be closed. For global vehicle lists, the no-staiton index of -1 was not taken into account 2005-02-22 20:32:26 +00:00
tron eed181245d (svn r1833) byte -> char transition: the rest 2005-02-06 22:25:27 +00:00
tron b2ae5b197e (svn r1821) Move generic string handling functions to string.[ch] and introduce stre{cpy,cat}, see string.h for their semantics 2005-02-06 13:41:02 +00:00
tron 0381073e56 (svn r1813) Declare functions implemented in strings.c in their own shiny new header (though i think some of these function don't belong into strings.c) 2005-02-06 08:18:00 +00:00
tron 7aae12d55d (svn r1808) Use strcmp() instead of home brewed function str_eq() 2005-02-05 22:50:33 +00:00
tron 993a106679 (svn r1676) Increase the size of TileIndex and TileIndexDiff to 32bits and adapt the save/load data and some other parts of the code to that change
WARNING: If i made any mistake here it WILL lead to corrupted savegames!
2005-01-25 21:43:57 +00:00
tron 189ca73707 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 2005-01-22 20:23:18 +00:00
darkvater 559317f9d0 (svn r1522) -Fix: warning players.c; forgot return type. Damn, makefile is too strict ;) (Thx Tron) 2005-01-15 10:04:04 +00:00
tron 3279a7c9a2 (svn r1520) Trim 134 (!) lines with trailing whitespace ): 2005-01-15 08:58:31 +00:00
darkvater f9b5f704b1 (svn r1518) -Fix: server issue where some company names were wrong
-Fix: Highscore troubles; accessing members of deleted window
2005-01-15 01:52:23 +00:00
darkvater 75474e5bf1 (svn r1516) -Cheating players do not get their names added to the highscore table/file
-Fixed issue where highscore window would not come up after endgame screen
-Fix: VS6 compiles once again (braindead compiler)
2005-01-15 00:46:45 +00:00
darkvater 06cc62f40d (svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
-Fix: fixed some compiler warnings
-Added PF_NETWORK_ONLY flag to settings. Such a setting can only be modified in a network game.
2005-01-13 16:28:47 +00:00
darkvater 5fac6142e8 (svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu)
-Added endgame score on 1 jan 2051 where you are added to the highscore if sufficiently large points have been accumulated. Game is paused while
-These values are saved in hs.dat; added read/write functions for it
-Added code to delete all windows to show charts. There is one issue left: somehow a news-gui pops up in front of the the chart at the end of the game.
2005-01-11 00:54:06 +00:00
truelight 4d94803d32 (svn r1169) -Fix: [Network] [ 1087591 ] When you want to be a spectator, you now
stay a spectator even if someone else joins.
2004-12-19 10:24:45 +00:00
truelight 5e28fb8f97 (svn r1131) -Add: [Network] Autoclean_companies (set it with 'set autoclean_companies on/off').
When enabled, empty companies (companies with no active clients) with no 
 password are declared bankrupt after 1 year of emptyness.
For empty companies with password, the password is removed after 3 years 
 of emptyness.
The delay of removing company/password can be configured via:
 - 'set autoclean_protected <months>'
 - 'set autoclean_unprotected <months>'
2004-12-16 13:59:23 +00:00
truelight 74a149127d (svn r1129) -Add: [Network] Added 'reset_company <company-id>'. If a company is
empty (no clients logged on to it), a server can delete a company via 
this command in the console.
2004-12-16 11:36:57 +00:00
tron 765ecfed84 (svn r1117) Move map arrays and some related macros into their own files map.c and map.h 2004-12-15 22:18:54 +00:00
truelight fa1f026367 (svn r1108) -Fix: [Network] Fixed problem around slow clients:
They joined, they got the map, but it took some time before the new 
player was created. In this time a player could do stuff, causing a 
player-id-mismatch, and the player was kicked out. Now a player get's a 
nice GUI which says: registering.. When that is gone, the player is 
joined and can play safely. Tnx to Moriarty for bugging me with this bug ;)
2004-12-15 21:13:52 +00:00
truelight 29b844a408 (svn r1096) -Fix: [Network] PlayAs is now registered correctly
-Codewise: [Network] Cleaned some code, removed some comment, changed 
some wrong comment
2004-12-15 15:19:51 +00:00
truelight b8f6d41418 (svn r942) -Merged branch/network back into the trunk 2004-12-04 17:54:56 +00:00
tron e56c3cddd8 (svn r925) Use sound enums
Also play the correct sound when a toyland road vehicle breaks down
2004-12-04 09:26:39 +00:00
tron fdb447ac55 (svn r901) Small step in the process to clean up the DPARAM mess:
- reduce to 2 sizes (*DParam64 for 64bit values, *DParam for the rest)
- use inline functions instead of macros
- add assert()s to check for buffer overruns
2004-12-02 22:53:07 +00:00
tron acbd1801c7 (svn r815) Include strings.h only in the files which need it.
This should reduce the compile time after altering english.txt by about 1/3, because "only" 62 instead of 90 .c files must be recompiled.
2004-11-25 10:47:30 +00:00
tron d641175e3c (svn r513) Merge revisions 402, 416, 417, 478, 479, 511, 512 from map to trunk
This includes 2 fixes
-Fix: [1048596] Monorail and Maglev sounds are swapped (r511)
-Add special case to load the jackhammer sound (r478)
The rest are cleanups und enumeration to make merging possible/easier
2004-11-05 23:12:33 +00:00
signde 1fb915df69 (svn r207) -Codechange: randomizer handling
-Fix: desync problem fixes
-Fix: server doesnt hang anymore when a client timed out
-Feature: low latency connection enhancements [*net_sync_freq, *net_ready_ahead]
2004-09-11 19:34:11 +00:00
truelight 7aa0bdf48b (svn r202) -Codechange: I missed some files with trailing spaces.. this should be
all ;)
2004-09-11 09:55:19 +00:00
darkvater aa02125158 (svn r166) -Codechange: change 74 for constant DAY_TICKS 2004-09-06 18:22:25 +00:00
truelight 788ace088d (svn r85) -Add: initial commit of new AI (enable in Patch menu)
-Add: generalised A* Algorithm
-Add: generalised queues (Fifo, Stack, InsSort, BinaryHeap)
2004-08-20 09:32:32 +00:00
truelight 0dd5113a98 (svn r24) Fix: competitors are starting more real 2004-08-11 22:30:29 +00:00
darkvater e4940ebc79 (svn r3) -[1005611] Player Window patch: When looking in dropdownlist for player stuff, it will say
for all human players (Player #), not only for the first 2
2004-08-10 14:32:17 +00:00
darkvater 804f038594 (svn r2) -Fix [993829] UDP Fixes (lucaspiller)
-Fix change 255/0xFF to OWNER_SPECTATOR for 
spectator stuff (TrueLight)
2004-08-10 14:14:00 +00:00
truelight efaeb275f7 (svn r1) Import of revision 975 of old (crashed) SVN 2004-08-09 17:04:08 +00:00