summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graph_gui.c8
-rw-r--r--lang/english.txt4
-rw-r--r--player_gui.c2
-rw-r--r--town_gui.c8
4 files changed, 17 insertions, 5 deletions
diff --git a/graph_gui.c b/graph_gui.c
index f0ae98eab..2e3c13e39 100644
--- a/graph_gui.c
+++ b/graph_gui.c
@@ -824,7 +824,13 @@ static void CompanyLeagueWndProc(Window *w, WindowEvent *e)
SET_DPARAM32(2, p->name_2);
SET_DPARAM16(3, GetPlayerNameString(p->index, 4));
- SET_DPARAM16(5, GetPerformanceTitleFromValue(p->old_economy[1].performance_history));
+ /* WARNING ugly hack!
+ GetPlayerNameString sets up (Player #) if the player is human in an extra DPARAM16
+ It seems that if player is non-human, nothing is set up, so param is 0. GetString doesn't like
+ that because there is another param after it.
+ So we'll just shift the rating one back if player is AI and all is fine
+ */
+ SET_DPARAM16((IS_HUMAN_PLAYER(i) ? 5 : 4), GetPerformanceTitleFromValue(p->old_economy[1].performance_history));
DrawString(2, 15 + i * 10, i == 0 ? STR_7054 : STR_7055, 0);
DrawPlayerIcon(p->index, 27, 16 + i * 10);
diff --git a/lang/english.txt b/lang/english.txt
index 26c82ca86..329ad5104 100644
--- a/lang/english.txt
+++ b/lang/english.txt
@@ -1767,8 +1767,8 @@ STR_7025_OPERATING_PROFIT_GRAPH :{WHITE}Operating Profit Graph
STR_7026_BANK_BALANCE :{WHITE}Bank Balance
STR_7027_LOAN :{WHITE}Loan
STR_7028 :{BLACK}{CURRENCY64}
-STR_7029_BORROW :{BLACK}Borrow {SKIP}{SKIP}{SKIP}{CURRENCY}
-STR_702A_REPAY :{BLACK}Repay {SKIP}{SKIP}{SKIP}{CURRENCY}
+STR_7029_BORROW :{BLACK}Borrow {SKIP}{SKIP}{SKIP}{SKIP}{CURRENCY}
+STR_702A_REPAY :{BLACK}Repay {SKIP}{SKIP}{SKIP}{SKIP}{CURRENCY}
STR_702B_MAXIMUM_PERMITTED_LOAN :{WHITE}...maximum permitted loan size is {CURRENCY}
STR_702C_CAN_T_BORROW_ANY_MORE_MONEY :{WHITE}Can't borrow any more money...
STR_702D_LOAN_ALREADY_REPAYED :{WHITE}...no loan to repay
diff --git a/player_gui.c b/player_gui.c
index 497c12811..38821d5ad 100644
--- a/player_gui.c
+++ b/player_gui.c
@@ -135,7 +135,7 @@ static void PlayerFinancesWndProc(Window *w, WindowEvent *e)
SET_DPARAM16(0, p->name_1);
SET_DPARAM32(1, p->name_2);
SET_DPARAM16(2, GetPlayerNameString((byte)w->window_number, 3));
- SET_DPARAM32(3, 10000);
+ SET_DPARAM32(4, 10000);
DrawWindowWidgets(w);
DrawPlayerEconomyStats(p, (byte)WP(w,def_d).data_1);
diff --git a/town_gui.c b/town_gui.c
index d103b4503..a8e5718e3 100644
--- a/town_gui.c
+++ b/town_gui.c
@@ -126,7 +126,13 @@ static void TownAuthorityWndProc(Window *w, WindowEvent *e)
(str++, r <= 800) || // Excellent
(str++, true); // Outstanding
- SET_DPARAM16(4, str);
+ /* WARNING ugly hack!
+ GetPlayerNameString sets up (Player #) if the player is human in an extra DPARAM16
+ It seems that if player is non-human, nothing is set up, so param is 0. GetString doesn't like
+ that because there is another param after it.
+ So we'll just shift the rating one back if player is AI and all is fine
+ */
+ SET_DPARAM16((IS_HUMAN_PLAYER(p->index) ? 4 : 3), str);
DrawString(19, y, STR_2024, 0);
y+=10;
}