diff options
author | tron <tron@openttd.org> | 2006-02-06 09:18:04 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-02-06 09:18:04 +0000 |
commit | 453b30e387f8d8ab1839d96b0d1f9a8fea841292 (patch) | |
tree | 3a4002304d8204d11c37ba706d6ffbd2e5dfac1b /disaster_cmd.c | |
parent | 0755bbead0240f519c9d78bb88ef4629d5ab8fa5 (diff) | |
download | openttd-453b30e387f8d8ab1839d96b0d1f9a8fea841292.tar.xz |
(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
Diffstat (limited to 'disaster_cmd.c')
-rw-r--r-- | disaster_cmd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/disaster_cmd.c b/disaster_cmd.c index 39e97c1b2..2c8c6e73c 100644 --- a/disaster_cmd.c +++ b/disaster_cmd.c @@ -898,10 +898,11 @@ static void Disaster6_Init(void) static void Disaster7_Init(void) { int index = GB(Random(), 0, 4); - Industry *i; uint m; for (m = 0; m < 15; m++) { + const Industry* i; + FOR_ALL_INDUSTRIES(i) { if (i->xy != 0 && i->type == IT_COAL_MINE && --index < 0) { SetDParam(0, i->town->index); |