summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-11-28 11:30:12 +0000
committertruelight <truelight@openttd.org>2005-11-28 11:30:12 +0000
commit4624bf7f9c8d0f673693391b70c12d83c507151c (patch)
treeef2779658b3c45860352a0f98036d195e566a04f
parent71b6f6c8aac713f6470a5c6c9f749f138ce52e84 (diff)
downloadopenttd-4624bf7f9c8d0f673693391b70c12d83c507151c.tar.xz
(svn r3243) -Fix: IncreaseLoan and DecreaseLoan were inconsistent for AIs
-rw-r--r--misc_cmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/misc_cmd.c b/misc_cmd.c
index 9f1244210..4b7ba122e 100644
--- a/misc_cmd.c
+++ b/misc_cmd.c
@@ -13,6 +13,7 @@
#include "economy.h"
#include "network.h"
#include "variables.h"
+#include "ai/ai.h"
/** Change the player's face.
* @param x,y unused
@@ -75,7 +76,7 @@ int32 CmdIncreaseLoan(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
/* Loan the maximum amount or not? */
- int32 loan = (p2) ? _economy.max_loan - p->current_loan : IS_HUMAN_PLAYER(_current_player) ? 10000 : 50000;
+ int32 loan = (p2) ? _economy.max_loan - p->current_loan : (IS_HUMAN_PLAYER(_current_player) || _patches.ainew_active || _ai.gpmi) ? 10000 : 50000;
p->money64 += loan;
p->current_loan += loan;
@@ -109,7 +110,7 @@ int32 CmdDecreaseLoan(int x, int y, uint32 flags, uint32 p1, uint32 p2)
loan = max(loan, 10000);
loan -= loan % 10000;
} else {
- loan = (_patches.ainew_active) ? min(loan, 10000) : min(loan, IS_HUMAN_PLAYER(_current_player) ? 10000 : 50000);
+ loan = min(loan, (IS_HUMAN_PLAYER(_current_player) || _patches.ainew_active || _ai.gpmi) ? 10000 : 50000);
}
if (p->player_money < loan) {