diff options
author | tron <tron@openttd.org> | 2005-11-14 19:48:04 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-11-14 19:48:04 +0000 |
commit | f7abff5f963cddfdd134ac52ffd8e72e3ed88f0c (patch) | |
tree | a9ba5d4f3c5c47ab3857060c5f95ed482530ed97 /ai/ai.c | |
parent | d8b56c123eab7f7b48f2af3579130e366f6106ab (diff) | |
download | openttd-f7abff5f963cddfdd134ac52ffd8e72e3ed88f0c.tar.xz |
(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
Diffstat (limited to 'ai/ai.c')
-rw-r--r-- | ai/ai.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -125,9 +125,9 @@ static void AI_RunTick(PlayerID player) Player *p = GetPlayer(player); _current_player = player; - if (_patches.ainew_active) + if (_patches.ainew_active) { AiNewDoGameLoop(p); - else { + } else { /* Enable all kind of cheats the old AI needs in order to operate correctly... */ _is_old_ai_player = true; AiDoGameLoop(p); @@ -143,8 +143,7 @@ static void AI_RunTick(PlayerID player) void AI_RunGameLoop(void) { /* Don't do anything if ai is disabled */ - if (!_ai.enabled) - return; + if (!_ai.enabled) return; /* New tick */ _ai.tick++; @@ -212,11 +211,9 @@ void AI_Initialize(void) */ void AI_Uninitialize(void) { - Player *p; + Player* p; FOR_ALL_PLAYERS(p) { - if (p->is_active && p->is_ai) { - AI_PlayerDied(p->index); - } + if (p->is_active && p->is_ai) AI_PlayerDied(p->index); } } |