(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 ;))
This commit is contained in:
truelight
2005-02-01 18:32:01 +00:00
parent 567224e940
commit 59ac6e8c4b
7 changed files with 106 additions and 42 deletions

View File

@@ -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;