From 546fcfa3ec6828dba8ebedac449a96284bfd7e06 Mon Sep 17 00:00:00 2001 From: truelight Date: Thu, 30 Dec 2004 10:03:35 +0000 Subject: (svn r1301) -Codechange: _industries finally has FOR_ALL_INDUSTRIES too --- disaster_cmd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'disaster_cmd.c') diff --git a/disaster_cmd.c b/disaster_cmd.c index a1bf71644..7ea7f747c 100644 --- a/disaster_cmd.c +++ b/disaster_cmd.c @@ -755,7 +755,9 @@ static void Disaster2_Init() Vehicle *v,*u; int x,y; - for(found=NULL,i=_industries; i != endof(_industries); i++) { + found = NULL; + + FOR_ALL_INDUSTRIES(i) { if (i->xy != 0 && i->type == IT_OIL_REFINERY && (found==NULL || CHANCE16(1,2))) { @@ -789,7 +791,9 @@ static void Disaster3_Init() Vehicle *v,*u,*w; int x,y; - for(found=NULL,i=_industries; i != endof(_industries); i++) { + found = NULL; + + FOR_ALL_INDUSTRIES(i) { if (i->xy != 0 && i->type == IT_FACTORY && (found==NULL || CHANCE16(1,2))) { @@ -896,7 +900,7 @@ static void Disaster7_Init() int index = Random() & 0xF; do { - for(i=_industries; i != endof(_industries); i++) { + FOR_ALL_INDUSTRIES(i) { if (i->xy != 0 && i->type == IT_COAL_MINE && --index < 0) { SetDParam(0, i->town->index); -- cgit v1.2.3-54-g00ecf