if (!AITown.HasStatue(town)) {
if (AITown.IsActionAvailable(town, AITown.TOWN_ACTION_BUILD_STATUE)) {
local perform_action = true;
if (cvgs.IsCompanyValueGSGame() && cvgs.GetCompanyIDRank(AICompany.ResolveCompanyID(AICompany.COMPANY_SELF)) == 1 && cvgs.RankingList().Count() > 1) {
if (TestPerformTownAction().TestCost(town, AITown.TOWN_ACTION_BUILD_STATUE) > cvgs.GetCompanyIDDiffToNext(AICompany.ResolveCompanyID(AICompany.COMPANY_SELF), false)) {
perform_action = false;
}
}
if (perform_action && AITown.PerformTownAction(town, AITown.TOWN_ACTION_BUILD_STATUE)) {
AILog.Warning("Built a statue in " + AITown.GetName(town) + ".");
}
}