summaryrefslogtreecommitdiff
path: root/players.c
AgeCommit message (Collapse)Author
2005-11-14(svn r3181) -Bracingtron
-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(svn r3177) GB, CLRBIT, HASBIT, TOGGLEBITtron
2005-11-13(svn r3176) Use proper types, not some variants of inttron
2005-11-07(svn r3155) -Feature: [autoreplace] autoreplace can now remove cars from too ↵bjarni
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(svn r3154) - Fix: Last value of an array is lengthof-1; let's keep this at ↵Darkvater
a typo, shall we :P
2005-11-07(svn r3151) - Fix: showing the highscore might crash the game with an ↵Darkvater
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-10-31(svn r3109) Replace two occurrences of '256' with TOTAL_NUM_ENGINESpeter1138
2005-10-25(svn r3087) Rewrite GetPlayerRailtypes() so it doesn't depend on magical ↵tron
numbers to sort out wagons
2005-10-22(svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in ↵tron
comments, excess empty lines, minor other changes nothing spectacular, just some stuff, which piled up
2005-10-20(svn r3073) int/byte -> EngineID/PlayerID/VehicleIDtron
0/-1 -> INVALID_ENGINE 0x10 -> OWNER_NONE
2005-10-19(svn r3064) Replace some numbers by sprite namestron
2005-10-07(svn r3024) -Codechange: Another batch of replacements of ↵tron
int/uint/int16/byte/-1 with proper types and constants
2005-10-03(svn r3010) Get rid of quite some dubious casts, either by using GB(), ↵tron
proper types or just removing them
2005-09-30(svn r3001) s/Player*/const Player*/tron
s/byte/PlayerID/ s/int/PlayerID/ and related changes
2005-09-28(svn r2995) Replace 0xFF/0xFFFF with ↵tron
CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate
2005-09-18(svn r2962) - const correctness for all Get* functions and most Draw* ↵Darkvater
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-14(svn r2951) - Fix: [ 1259345 ] Changing engine in netgame opens train window ↵Darkvater
for everyone - Add IsLocalPlayer() which substitutes _local_player == _current_player
2005-09-07(svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)truelight
-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-02(svn r2907) -Codechange: splitted the AIs to their own directory. AINew ↵truelight
becomes 'trolly', AIOld becomes 'default', both in their own dir in the 'ai' dir. More AIs to come.
2005-08-06(svn r2817) -Codechange: [autoreplace]: moved autoreplace and autorenew to ↵bjarni
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-07-26(svn r2720) Remove unused declarations and definitionstron
2005-07-24(svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic ↵celestar
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(svn r2701) Insert Id tags into all source filestron
2005-07-23(svn r2684) Correctly save and load company_value, it's 64 bits wide, not 32 ↵tron
bits
2005-07-22(svn r2673) Include functions.h directly, not globally via openttd.htron
2005-07-21(svn r2669) Shuffle some more stuff around to reduce dependenciestron
2005-07-21(svn r2664) Remove depedency on player.h from variables.htron
2005-07-21(svn r2660) Get rid of some more shifting/anding/castingtron
2005-07-20(svn r2657) -Codechange: The available railtypes per player are now a ↵celestar
bitmask, so that railtypes do not be in ascending order of appearance. Allows easier implementation or more railtypes
2005-07-20(svn r2650) Convert many explicit shifts+ands to extract bits to invocations ↵tron
of GB - should be a bit nicer to read
2005-07-18(svn r2629) -Codechange: removed stupid comment on top of players.ctruelight
2005-07-17(svn r2617) - Fix: fix some warnings, and reenable vs.net2003 ↵Darkvater
signed/unsigned warnings
2005-07-17(svn r2606) -Codechange: renamed ai.c to ai_old.c, and ai.h to ai_new.h to ↵truelight
make room for a global AI-handler
2005-07-17(svn r2602) -Codechange: removed unused variable (disable_computer)truelight
-Fix: Changed some stuff to make server-side AIs possible in the far future
2005-07-15(svn r2580) Change: Added {INDUSTRY} command for printing industry names ↵ludde
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-06-24(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"tron
2005-06-21(svn r2468) -Codechange: Got rid of DEREF_PLAYER and replaced it by GetPlayercelestar
2005-06-04(svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix ↵tron
some bogus reads of _map_owner
2005-06-02(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.Darkvater
2005-05-30(svn r2387) - CodeChange: made the saveload code more readable and also ↵Darkvater
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-17(svn r2339) - Fix: on a dedicated server, after the joining of a player, the ↵Darkvater
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-15(svn r2324) Introduce _cmd_text for passing strings with a command instead ↵tron
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-14(svn r2316) - Fix: [ 1154454 ] Fix BeOS build on Trunk (myob)Darkvater
2005-05-12(svn r2300) - CodeChange: check the last number of commands, now only the ↵Darkvater
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-11(svn r2291) - Fix (regression): When a client joined it changed the ↵Darkvater
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-03-27(svn r2080) - Fix: [OldAI] p->ai.state_counter was uint16 but could hold a ↵pasky
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-02-22(svn r1906) - Fix: [ 1117327 ] Assertion error on kick. When a company is ↵Darkvater
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-06(svn r1833) byte -> char transition: the resttron
2005-02-06(svn r1821) Move generic string handling functions to string.[ch] and ↵tron
introduce stre{cpy,cat}, see string.h for their semantics
2005-02-06(svn r1813) Declare functions implemented in strings.c in their own shiny ↵tron
new header (though i think some of these function don't belong into strings.c)