summaryrefslogtreecommitdiff
path: root/bin/ai/wrightai
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2009-01-16 00:05:26 +0000
committertruebrain <truebrain@openttd.org>2009-01-16 00:05:26 +0000
commit94dd36d1eceb487616f9f0ea260fbe00d84cc267 (patch)
tree9e3c6b823cc8e282db94a22336d126affeaaac1c /bin/ai/wrightai
parent5119132dda807aacb65e2afcce22665e7eedc577 (diff)
downloadopenttd-94dd36d1eceb487616f9f0ea260fbe00d84cc267.tar.xz
(svn r15101) -Change [API CHANGE]: more consistant naming for consts:
INVALID_TOWN_RATING -> TOWN_RATING_INVALID INVALID_TRANSPORT -> TRANSPORT_INVALID INVALID_ORDER -> ORDER_INVALID INVALID_GROUP -> GROUP_INVALID GROUP_ALL/DEFAULT -> ALL/DEFAULT_GROUP VEHICLE_RAIL/ROAD/.. -> VT_RAIL/ROAD/.. MY_COMPANY -> COMPANY_SELF FIRST/LAST/INVALID_COMPANY -> COMPANY_FIRST/LAST/INVALID
Diffstat (limited to 'bin/ai/wrightai')
-rw-r--r--bin/ai/wrightai/main.nut12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/ai/wrightai/main.nut b/bin/ai/wrightai/main.nut
index 53b387b2e..3c10aeca9 100644
--- a/bin/ai/wrightai/main.nut
+++ b/bin/ai/wrightai/main.nut
@@ -32,7 +32,7 @@ class WrightAI extends AIController {
*/
function WrightAI::HasMoney(money)
{
- if (AICompany.GetBankBalance(AICompany.MY_COMPANY) + (AICompany.GetMaxLoanAmount() - AICompany.GetLoanAmount()) > money) return true;
+ if (AICompany.GetBankBalance(AICompany.COMPANY_SELF) + (AICompany.GetMaxLoanAmount() - AICompany.GetLoanAmount()) > money) return true;
return false;
}
@@ -42,9 +42,9 @@ function WrightAI::HasMoney(money)
function WrightAI::GetMoney(money)
{
if (!this.HasMoney(money)) return;
- if (AICompany.GetBankBalance(AICompany.MY_COMPANY) > money) return;
+ if (AICompany.GetBankBalance(AICompany.COMPANY_SELF) > money) return;
- local loan = money - AICompany.GetBankBalance(AICompany.MY_COMPANY) + AICompany.GetLoanInterval() + AICompany.GetLoanAmount();
+ local loan = money - AICompany.GetBankBalance(AICompany.COMPANY_SELF) + AICompany.GetLoanInterval() + AICompany.GetLoanAmount();
loan = loan - loan % AICompany.GetLoanInterval();
AILog.Info("Need a loan to get " + money + ": " + loan);
AICompany.SetLoanAmount(loan);
@@ -109,10 +109,10 @@ function WrightAI::BuildAircraft(tile_1, tile_2)
local hangar = AIAirport.GetHangarOfAirport(tile_1);
local engine = null;
- local engine_list = AIEngineList(AIVehicle.VEHICLE_AIR);
+ local engine_list = AIEngineList(AIVehicle.VT_AIR);
/* When bank balance < 300000, buy cheaper planes */
- local balance = AICompany.GetBankBalance(AICompany.MY_COMPANY);
+ local balance = AICompany.GetBankBalance(AICompany.COMPANY_SELF);
engine_list.Valuate(AIEngine.GetPrice);
engine_list.KeepBelowValue(balance < 300000 ? 50000 : (balance < 1000000 ? 300000 : 1000000));
@@ -335,7 +335,7 @@ function WrightAI::Start()
i++;
}
}
- this.name = AICompany.GetName(AICompany.MY_COMPANY);
+ this.name = AICompany.GetName(AICompany.COMPANY_SELF);
/* Say hello to the user */
AILog.Info("Welcome to WrightAI. I will be building airports all day long.");
AILog.Info(" - Minimum Town Size: " + GetSetting("min_town_size"));