src/ai/api/ai_town.cpp
branchnoai
changeset 10194 c9fdeb7450da
parent 9833 89a64246458f
child 10339 ce6cd68d9eb8
equal deleted inserted replaced
10193:9f73edc0c57a 10194:c9fdeb7450da
    37 	return town_name;
    37 	return town_name;
    38 }
    38 }
    39 
    39 
    40 /* static */ int32 AITown::GetPopulation(TownID town_id)
    40 /* static */ int32 AITown::GetPopulation(TownID town_id)
    41 {
    41 {
    42 	if (!IsValidTown(town_id)) return 0;
    42 	if (!IsValidTown(town_id)) return -1;
    43 	const Town *t = ::GetTown(town_id);
    43 	const Town *t = ::GetTown(town_id);
    44 	return t->population;
    44 	return t->population;
    45 }
    45 }
    46 
    46 
    47 /* static */ TileIndex AITown::GetLocation(TownID town_id)
    47 /* static */ TileIndex AITown::GetLocation(TownID town_id)