diff options
author | truelight <truelight@openttd.org> | 2005-02-01 18:32:01 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2005-02-01 18:32:01 +0000 |
commit | 777dd99585ca5a775cd189eedd81e27d3ca395ed (patch) | |
tree | b7d40aab99c9bff1a5304e4659c8cc7748b8a881 /ai_new.c | |
parent | 6d5fdc2b6883f3522ccd0d4fa49e5855c5c70f79 (diff) | |
download | openttd-777dd99585ca5a775cd189eedd81e27d3ca395ed.tar.xz |
(svn r1764) -Add: dynamic towns, you can now have up to 64k towns (let me know when
you have that amount of towns in a map ;))
Diffstat (limited to 'ai_new.c')
-rw-r--r-- | ai_new.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -366,11 +366,11 @@ static void AiNew_State_LocateRoute(Player *p) { // increase the temp with one, and return. We will come back later here // to try again p->ainew.temp++; - if (p->ainew.from_type == AI_CITY) { - if (p->ainew.temp >= _total_towns) p->ainew.temp = 0; - } else { - if (p->ainew.temp >= _total_industries) p->ainew.temp = 0; - } + if (p->ainew.from_type == AI_CITY) { + if (p->ainew.temp >= (int)_total_towns) p->ainew.temp = 0; + } else { + if (p->ainew.temp >= _total_industries) p->ainew.temp = 0; + } // Don't do an attempt if we are trying the same id as the last time... if (p->ainew.last_id == p->ainew.temp) return; @@ -489,15 +489,15 @@ static void AiNew_State_LocateRoute(Player *p) { } } - // It was not a valid city - // increase the temp with one, and return. We will come back later here - // to try again - p->ainew.temp++; - if (p->ainew.to_type == AI_CITY) { - if (p->ainew.temp >= _total_towns) p->ainew.temp = 0; - } else { - if (p->ainew.temp >= _total_industries) p->ainew.temp = 0; - } + // It was not a valid city + // increase the temp with one, and return. We will come back later here + // to try again + p->ainew.temp++; + if (p->ainew.to_type == AI_CITY) { + if (p->ainew.temp >= (int)_total_towns) p->ainew.temp = 0; + } else { + if (p->ainew.temp >= _total_industries) p->ainew.temp = 0; + } // Don't do an attempt if we are trying the same id as the last time... if (p->ainew.last_id == p->ainew.temp) return; |