Bug in NoAI API: AITown.GetTownRating
Posted: 08 Jul 2010 23:52
Dear devs,
I think the AITown.GetTownRating returns the wrong town rating. It seems that when I check for:
The code actually checks for AITown.TOWN_RATING_VERY_GOOD. So it seems that all the values assigned to the town ratings are 1 too high. The function in src/ai/api/ai_town.cpp should read:
For instance, when the town's rating is 1, it should return TOWN_RATING_MEDIOCRE (4) but it returns TOWN_RATING_POOR (3).
Cheers,
Bram
I think the AITown.GetTownRating returns the wrong town rating. It seems that when I check for:
Code: Select all
local companyID = AICompany.ResolveCompanyID(AICompany.COMPANY_SELF);
if (AITown.GetTownRating(town, companyID) == AITown.TOWN_RATING_GOOD) {
...
}
Code: Select all
return max(TOWN_RATING_APPALLING, (TownRating)((t->ratings[company] / 200) + 4));
Cheers,
Bram