summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-01-23 19:33:42 +0000
committertruelight <truelight@openttd.org>2005-01-23 19:33:42 +0000
commitbf3190d7f4350265fd566cc3248362b80e1341bc (patch)
tree14bfada166e54b6a78061ec21113942460659039
parent5f6b7664f4b23b0166041c4bb4232e2706bb0451 (diff)
downloadopenttd-bf3190d7f4350265fd566cc3248362b80e1341bc.tar.xz
(svn r1622) -Fix: variables can't be defined after a statement.. (Igor2Code)
-rw-r--r--misc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/misc.c b/misc.c
index 2e400248b..e816d4476 100644
--- a/misc.c
+++ b/misc.c
@@ -34,6 +34,10 @@ uint32 DoRandom(int line, const char *file)
uint32 Random(void)
#endif
{
+
+uint32 s;
+uint32 t;
+
#ifdef RANDOM_DEBUG
if (_networking && (DEREF_CLIENT(0)->status != STATUS_INACTIVE || !_network_server))
printf("Random [%d/%d] %s:%d\n",_frame_counter, _current_player, file, line);
@@ -41,8 +45,8 @@ uint32 Random(void)
#ifdef PLAYER_SEED_RANDOM
if (_current_player>=MAX_PLAYERS || !_networking) {
- uint32 s = _random_seeds[0][0];
- uint32 t = _random_seeds[0][1];
+ s = _random_seeds[0][0];
+ t = _random_seeds[0][1];
_random_seeds[0][0] = s + ROR(t ^ 0x1234567F, 7);
return _random_seeds[0][1] = ROR(s, 3);
} else {
@@ -53,8 +57,8 @@ uint32 Random(void)
return _player_seeds[_current_player][1] = ROR(s, 3);
}
#else
- uint32 s = _random_seeds[0][0];
- uint32 t = _random_seeds[0][1];
+ s = _random_seeds[0][0];
+ t = _random_seeds[0][1];
_random_seeds[0][0] = s + ROR(t ^ 0x1234567F, 7);
return _random_seeds[0][1] = ROR(s, 3);
#endif