summaryrefslogtreecommitdiff
path: root/players.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-08-11 22:30:29 +0000
committertruelight <truelight@openttd.org>2004-08-11 22:30:29 +0000
commit0dd5113a98b6e75010b93cf2fba462c035a79d57 (patch)
treed5f9cd5049992dc0031f372cc6acff9aff2fcf73 /players.c
parentf42201496093f04220e58b1c4cd4d69531839de4 (diff)
downloadopenttd-0dd5113a98b6e75010b93cf2fba462c035a79d57.tar.xz
(svn r24) Fix: competitors are starting more real
Diffstat (limited to 'players.c')
-rw-r--r--players.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/players.c b/players.c
index 7aafdaa70..5901b0db0 100644
--- a/players.c
+++ b/players.c
@@ -492,10 +492,8 @@ Player *DoStartupNewPlayer(bool is_ai)
void StartupPlayers()
{
- uint32 r;
-
- r = Random();
- _next_competitor_start = (byte)r + _opt.diff.competitor_start_time * 6882 + 1;
+ // The AI starts like in the setting with +2 month max
+ _next_competitor_start = _opt.diff.competitor_start_time * 90 * 74 + RandomRange(60 * 74) + 1;
}
static void MaybeStartNewPlayer()
@@ -510,10 +508,11 @@ static void MaybeStartNewPlayer()
n++;
// when there's a lot of computers in game, the probability that a new one starts is lower
- if (n < (uint)_opt.diff.max_no_competitors && n < RandomRange(_opt.diff.max_no_competitors))
+ if (n < (uint)_opt.diff.max_no_competitors && n < RandomRange(_opt.diff.max_no_competitors + 2))
DoStartupNewPlayer(true);
- _next_competitor_start = RandomRange(19980) + 11100;
+ // The next AI starts like the difficulty setting said, with +2 month max
+ _next_competitor_start = _opt.diff.competitor_start_time * 90 * 74 + RandomRange(60 * 74) + 1;
}
void InitializePlayers()