Commit Graph

59 Commits (8caedb4898761a24d300daf1ee7096a05dbe2df2)

Author SHA1 Message Date
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
Darkvater 44131d5416 (svn r3481) - Try and fix an svn discrepancy of trolly.h #2 19 years ago
Darkvater d774ae91ae (svn r3480) - Try and fix an svn discrepancy of trolly.h 19 years ago
Darkvater 4014e36aec (svn r3472) - [PBS] Remove from trunk. Anyone interested can still find it in branch/pbs. This reverts revisions r3158, r3140, r3075, r2977, r2674, r2625, r2621, r2529, r2528, r2525, r2524, r2519, r2517, r2516, r2507, r2499. (in conjunction with Tron)
- The only change is that the nsignalsw.grf file is kept and that existing nightlies with PBS signals get those signals converted to combo-signals.
19 years ago
tron 2053685fb5 (svn r3367) Unify the 4 distinct CMD_CHANGE_{AIRCRAFT,ROADVEH,SHIP,TRAIN}_SERVICE_INT commands into one CMD_CHANGE_SERVICE_INT command.
As side effect this is a
-Fix: The default AI tried to change the service intervals of vehicles via the CMD_CHANGE_TRAIN_SERVICE_INT command - regardless of the type of the vehicle - which of course failed for non-trains
19 years ago
tron 318fe153eb (svn r3365) Staticise 36 functions 19 years ago
tron d5aa95b87e (svn r3313) Remove GPMI related changes from trunk
Revisions in detail: 2542, 3226 (partial), 3229, 3231, 3232, 3238, 3242-3245, 3251, 3253, 3260, 3263, 3265, 3266, 3269, 3277, 3278, 3279, 3283 (partial), 3304, 3305, 3306
19 years ago
truelight e88942f490 (svn r3306) -Fix: forgot sometimes to switch to the right current_player for AIs 19 years ago
truelight 6ca528ec82 (svn r3305) -Rename: Changed all instances of ottd_ related to the AI to ttai_ 19 years ago
truelight 607e518ab8 (svn r3304) -Add: allow AI-events to see the UID of the command
-Fix: improved the logic of the UID code for AIs
19 years ago
tron a2533d5ee6 (svn r3298) Remove unused and write-only variables 19 years ago
tron 9822b4d755 (svn r3297) Staticise 19 years ago
Darkvater 573ce05eb8 (svn r3294) - Fix: use INVALID_STRING_ID instead of -1.
- Fix: savegames only give back one message, show this by ignoring the first argument. Perhaps make the message more verbose in the future by adding STR_ equivalents next to the already existing debug messages.
19 years ago
truelight ad756fff55 (svn r3285) -Codechange: Tron was confused by a name, so let's make him happy,
prefixed it with 'tmp', so now we know it is a temp char* :)
19 years ago
truelight af1531db4a (svn r3284) -Fix: DoCommand always cleans up _cmd_text (tnx to Tron) 19 years ago
truelight d8721d33e6 (svn r3283) -Fix: decode_parameters was still used, while _cmd_text is the way
-Fix: _cmd_text is cleared after a command, so we need to store it 
  temporaray in order to first test the command, before executing
19 years ago
peter1138 80986fcd32 (svn r3282) - Codechange: Replace tests against CMD_ERROR with CmdFailed() 19 years ago
truelight b450e0228b (svn r3279) -Fix: do not try to execute something that is not set to execute
-Fix: do not increase an uid number if it isn't returned
19 years ago
truelight 0941c039ab (svn r3278) -Fix: lets update the tail-pointer if we add a new item, else the linkedlist never grows ;) 19 years ago
truelight e9e5f2a235 (svn r3277) -Fix: lets use the right DoCommand for testing a build (tnx to Igor2Code) 19 years ago
bjarni e486e56050 (svn r3272) -Fix: [AI] fixed issue in AI that prevented compilation without network support 19 years ago
truelight ef36eaad4a (svn r3269) -Fix: return CMD_ERROR instead of -1 if AI_DoCommandChecked fails 19 years ago
truelight bab6f56967 (svn r3266) -Codechange: added comments for why the revert of r3625 inside the code.
Also, I forgot to tnx GraphiteNL for his help with this problem. Tnx GraphiteNL :)
19 years ago
truelight e5fa92384d (svn r3265) -Fix: partly reverted back r3263, because MSVC, who else, doesn't support variadic macros............ 19 years ago
truelight 2390595d3b (svn r3263) -Fix: use () around 'variables' in macros, gives less crashes ;)
-Fix: va-args in macros are supported via __VA_ARGS__ in C99, so changed
       to that; now GCC 2.95 likes it too :)
19 years ago
truelight a7a5a3a8e8 (svn r3260) -Add: add events for AIs to check if a command execution failed or succeeded 19 years ago
truelight d90e3118ed (svn r3253) -Add: add BuildRoad event for AIs 19 years ago
truelight 5e4a1a4dc1 (svn r3251) -Fix: report errors from GPMI in a more detailed way (Igor2Code) 19 years ago
truelight a518f81093 (svn r3250) -Fix: AIs weren't uninitialized when a new game was loaded 19 years ago
truelight 708c135ff7 (svn r3246) -Fix: small glitch in ai_network_client code (network_client.c)
-Fix: make sure this glitch can never happen again (ai.c)
19 years ago
truelight 90e50e5ca9 (svn r3245) -Add: allow OpenTTD to give his GPMI-params to the GPMI modules 19 years ago
truelight 4c76c9a45a (svn r3244) -Fix: [GPMI] Even more GPMI based AI-code cleanup, bug fixes, and you can now control the AI that is going to boot 19 years ago
truelight 71b6f6c8aa (svn r3242) -Fix: small glitch in AllowAI control 19 years ago
truelight 29a0f76ac9 (svn r3238) -Fix: always save if you want GPMI-based AIs, this on request by
Darkvater, so we can, in the future, save patch options in savegames 
without any problems.
19 years ago
Darkvater 43b09db5ed (svn r3236) - Fix: warnings about 'CDECL must be used with ...' on VS6 19 years ago
truelight 8315736569 (svn r3232) -Add: implemented the event-system for AIs
-Add: added several hooks (event-callbacks) for road-related-stuff
19 years ago
truelight d9e13cef71 (svn r3229) -Add: add more GPMI support. Now GPMI-based AIs can be loaded (doesn't change a thing if you didn't enable GPMI) 19 years ago
truelight e4cb8ed457 (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
19 years ago
truelight af6fe3949b (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!
19 years ago
tron 7289cc7c07 (svn r3190) Turn some loops into canonical for loop form 19 years ago
tron 8a3587fa28 (svn r3185) const 19 years ago
tron 9d0e7b6458 (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
19 years ago
tron 524fd25cbd (svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT 19 years ago
tron 81e5b16d71 (svn r3172) static, const 19 years ago
tron 5536de2319 (svn r3080) byte -> PlayerID, int -> EngineID, -1 -> INVALID_ENGINE 19 years ago
tron 181d586a7c (svn r3078) Some more stuff, which piled up:
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
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 d7cbd0d4c3 (svn r3073) int/byte -> EngineID/PlayerID/VehicleID
0/-1 -> INVALID_ENGINE
0x10 -> OWNER_NONE
19 years ago
tron a85d68ed57 (svn r3058) The default AI may not build dual headed trains under certain circumstances.
Simplify this check by testing the rail vehicle info flags instead of passing a global variable around.
Note: This is not exactly the original behaviour, because the Lev4 was always allowed to be built, but i guess that was a glitch.
19 years ago